#include #include #include #include #define MAX_FILE_LEN 80 #define MAX_VEC_SIZE 80 #define MAX_MAT_SIZE 80 #define TOLERANCE 1e-8 #define MAXFLEN 80 #define ALPHA 1 #define BETA 0 /* structures */ typedef struct { int n; float *p;} Vector; typedef struct {int n; int m; float *p;} Matrix; /* Conjugate gradient function */ void cg(gsl_matrix_float *, gsl_vector_float *, gsl_vector_float *); /* Matrix and Vector I/O functions */ void mcreator(Matrix *); void vcreator(Vector *); void mreader(Matrix *); void vreader(Vector *); void mdestroy(Matrix *); void vdestroy(Vector *); void mconvert(Matrix *, gsl_matrix_float *); void vconvert(Vector *, gsl_vector_float *);