#include #include #include #define MAXFILELEN 80 #define TOLERANCE 10.0E-6 #define MAXITE 100 // read a matrix and vector, and create a vector gsl_matrix_float GetMat(char matfile[MAXFILELEN]); gsl_vector_float GetVec(char vecfile[MAXFILELEN]); gsl_vector_float CreatX(char matfile[MAXFILELEN]); //Solve Ax=b gsl_vector_float fCG(gsl_matrix_float A,gsl_vector_float x,gsl_vector_float b,float Tolerance,int MaxIte); //CG function void VectorSub(gsl_vector_float *a,gsl_vector_float *b,gsl_vector_float *ans); // 'substruct' function void VectorAdd(gsl_vector_float *a,gsl_vector_float *b,gsl_vector_float *ans); // 'add' function void VectorScale(gsl_vector_float *a,float x,gsl_vector_float *ans); // 'scale multiply' function