-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathlapacke_example_aux.c
33 lines (27 loc) · 1022 Bytes
/
lapacke_example_aux.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <lapacke.h>
#include <stdio.h>
/* Auxiliary routine: printing a matrix */
void print_matrix_rowmajor( char* desc, lapack_int m, lapack_int n, double* mat, lapack_int ldm ) {
lapack_int i, j;
printf( "\n %s\n", desc );
for( i = 0; i < m; i++ ) {
for( j = 0; j < n; j++ ) printf( " %6.2f", mat[i*ldm+j] );
printf( "\n" );
}
}
/* Auxiliary routine: printing a matrix */
void print_matrix_colmajor( char* desc, lapack_int m, lapack_int n, double* mat, lapack_int ldm ) {
lapack_int i, j;
printf( "\n %s\n", desc );
for( i = 0; i < m; i++ ) {
for( j = 0; j < n; j++ ) printf( " %6.2f", mat[i+j*ldm] );
printf( "\n" );
}
}
/* Auxiliary routine: printing a vector of integers */
void print_vector( char* desc, lapack_int n, lapack_int* vec ) {
lapack_int j;
printf( "\n %s\n", desc );
for( j = 0; j < n; j++ ) printf( " %6i", vec[j] );
printf( "\n" );
}