#include "header.h" int main(void) { /* My fancy timer */ // struct timeval starttime, endtime; /* Matrices and Vectors */ Matrix A; Vector b; gsl_matrix_float gsl_A; gsl_vector_float gsl_b; gsl_vector_float *gsl_x; /* create matrix and vector from file */ mcreator(&A); vcreator(&b); /* check input was read correctly */ // mreader(&A); // vreader(&b); /* convert to gsl structures */ mconvert(&A, &gsl_A); vconvert(&b, &gsl_b); // gettimeofday(&starttime, NULL); // start timer gsl_x = gsl_vector_float_alloc(gsl_A.size2); /* conjugate gradient algorithm: prints output inside * cg.c */ cg(&gsl_A, &gsl_b, gsl_x); /* Uncomment to get time */ // gettimeofday(&endtime, NULL); // end timer // printf("runtime = %f milliseconds\n", // (endtime.tv_usec - starttime.tv_usec)/1000.0); return EXIT_SUCCESS; }