You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

lapacke_example_aux.c 1.0 kB

123456789101112131415161718192021222324252627282930313233
  1. #include <lapacke.h>
  2. #include <stdio.h>
  3. /* Auxiliary routine: printing a matrix */
  4. void print_matrix_rowmajor( char* desc, lapack_int m, lapack_int n, double* mat, lapack_int ldm ) {
  5. lapack_int i, j;
  6. printf( "\n %s\n", desc );
  7. for( i = 0; i < m; i++ ) {
  8. for( j = 0; j < n; j++ ) printf( " %6.2f", mat[i*ldm+j] );
  9. printf( "\n" );
  10. }
  11. }
  12. /* Auxiliary routine: printing a matrix */
  13. void print_matrix_colmajor( char* desc, lapack_int m, lapack_int n, double* mat, lapack_int ldm ) {
  14. lapack_int i, j;
  15. printf( "\n %s\n", desc );
  16. for( i = 0; i < m; i++ ) {
  17. for( j = 0; j < n; j++ ) printf( " %6.2f", mat[i+j*ldm] );
  18. printf( "\n" );
  19. }
  20. }
  21. /* Auxiliary routine: printing a vector of integers */
  22. void print_vector( char* desc, lapack_int n, lapack_int* vec ) {
  23. lapack_int j;
  24. printf( "\n %s\n", desc );
  25. for( j = 0; j < n; j++ ) printf( " %6i", vec[j] );
  26. printf( "\n" );
  27. }