- Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathlapacke_example_aux.c
33 lines (27 loc) · 1.01 KB
/
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 */
voidprint_matrix_rowmajor( char*desc, lapack_intm, lapack_intn, double*mat, lapack_intldm ) {
lapack_inti, 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 */
voidprint_matrix_colmajor( char*desc, lapack_intm, lapack_intn, double*mat, lapack_intldm ) {
lapack_inti, 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 */
voidprint_vector( char*desc, lapack_intn, lapack_int*vec ) {
lapack_intj;
printf( "\n %s\n", desc );
for( j=0; j<n; j++ ) printf( " %6"LAPACK_IFMT, vec[j] );
printf( "\n" );
}