Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <gsl/gsl_matrix.h>
- #define N 8
- int main(int argc, char **argv) {
- gsl_matrix *e = gsl_matrix_alloc(N, N);
- gsl_matrix *f = gsl_matrix_alloc(N, N);
- FILE *in;
- if (argc > 1) in = fopen(argv[1], "r");
- else in = stdin;
- gsl_matrix_fscanf(in, e);
- gsl_matrix_fscanf(in, f);
- fclose(in);
- //
- // some operation
- //
- FILE *out = fopen("output.dat", "w");
- gsl_matrix_fprintf(out, e, "%e");
- gsl_matrix_fprintf(out, f, "%e");
- fclose(out);
- gsl_matrix_free(e);
- gsl_matrix_free(f);
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement