#include "header.h" int main(void) { gsl_matrix_float A; gsl_vector_float b; gsl_vector_float x; gsl_vector_float ans; char matfile[MAXFILELEN]; //the file name of the input matrix A char vecfile[MAXFILELEN]; //the file name of the input vector b scanf("%s", matfile); // read the file name of a matrix scanf("%s", vecfile); // read the file name of a vector // Get the matrix A and the vector b A=GetMat(matfile); b=GetVec(vecfile); // Create a vector x x=CreatX(matfile); // x is m by 1 // Solve the equation Ax=b fCG(A,x,b,TOLERANCE,MAXITE); // call the CG function gsl_vector_float_fprintf(stdout,&x,"%lf"); return 0; }