printmat.c (506B)
1 #include <stdio.h> 2 #include <stdlib.h> 3 4 // see https://www.gnu.org/software/gsl/manual/html_node/Matrices.html 5 #include <gsl/gsl_matrix.h> 6 7 #include "wernerparams.h" 8 #include "werner.h" 9 10 11 int main(int argc, char** argv) 12 { 13 14 // Allocate matrix Z: number of sand slabs 15 gsl_matrix* Z = gsl_matrix_alloc(rows, cols); 16 17 // Read matrix from stdin 18 gsl_matrix_fscanf(stdin, Z); 19 20 // Print formatted result to stdout 21 print_matrix(Z); 22 23 // End program 24 gsl_matrix_free(Z); 25 return 0; 26 }