Added conjugate gradient solver. Supports both full matrix and sparse matrix.