utils.h 618 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Tema 2 ASC
  3. * 2020 Spring
  4. * !!! Do not modify this file !!!
  5. */
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <sys/time.h>
  9. typedef double* (*Solver)(int, double *, double*);
  10. #define get_rand_double(limit) ((((double)rand()) / RAND_MAX) * (2 * limit) - limit)
  11. struct test {
  12. int seed;
  13. int N;
  14. // path to the file where the result matrix will be written
  15. char output_save_file[100];
  16. };
  17. double* my_solver(int, double *, double *);
  18. int run_test(struct test, Solver, float *);
  19. void free_data(double **);
  20. int generate_data(struct test, double **, int);
  21. int read_input_file(char *, int *, struct test **);