#include "header.h" int in(gsl_matrix_float **A,gsl_vector_float **b) { int vn,n,m; //"vn" is the lenght of the vector, "n" the rows of the matrix A, "m" the columns of the matrix A. char mafile[MAXLEN]; //to storage the input matrix file name char vfile[MAXLEN]; //to storage the input vector file name FILE *fin; scanf("%s",mafile); scanf("%s",vfile);// read the names of both files fin=fopen(mafile,"r"); fscanf(fin,"%d",&n); fscanf(fin,"%d",&m); (*A)=gsl_matrix_float_alloc(n,m); gsl_matrix_float_fscanf (fin,*A);// read in the matrix fin=fopen(vfile,"r"); fscanf(fin,"%d",&vn); (*b)=gsl_vector_float_alloc(vn); gsl_vector_float_fscanf (fin,*b);// read in the vector fclose(fin); return 1; } int out(gsl_vector_float *x) { printf("the solution for Ax=b : \n"); gsl_vector_float_fprintf(stdout,x,"%lf"); return 1; }