This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Eigen/Core> | |
#include <Eigen/Sparse> | |
#include <iostream> | |
using Vec = Eigen::VectorXd; | |
using Mat = Eigen::SparseMatrix<double,Eigen::RowMajor>; | |
void jacobi(const Mat &mat,const Vec &b,Vec &x,double eps,int max_iteration); | |
void sor(const Mat &mat,const Vec &b,Vec &x,double eps,int max_iteration,double omega); | |
void conjugate_gradient(const Mat &mat,const Vec &b,Vec &x,double eps,int max_iteration); |