42 int main(
int argc,
char **argv) {
55 for( i = 1; i < argc; i++ ) {
56 if( strcmp( argv[i],
"-n" ) == 0 ) {
60 if( strcmp( argv[i],
"-nrhs" ) == 0 ) {
61 nrhs = atoi(argv[i+1]);
68 A = (
double *)malloc(n*n*
sizeof(
double)) ;
69 if (A==NULL){ printf(
"error of memory allocation\n"); exit(0); }
70 b = (
double *)malloc(n*nrhs*
sizeof(
double)) ;
71 if (b==NULL){ printf(
"error of memory allocation\n"); exit(0); }
73 if (ipiv==NULL){ printf(
"error of memory allocation\n"); exit(0); }
75 for( i = 0; i < n; i++ ) {
76 for( j = 0; j < n; j++ ) A[i+j*lda] = ((
double) rand()) / ((double) RAND_MAX) - 0.5;
80 b[i] = ((
double) rand()) / ((
double) RAND_MAX) - 0.5;
89 printf(
"LAPACKE_dgesv (row-major, high-level) Example Program Results\n" );
96 printf(
"The diagonal element of the triangular factor of A,\n" );
97 printf(
"U(%i,%i) is zero, so that A is singular;\n", info, info );
98 printf(
"the solution could not be computed.\n" );
101 if (info <0) exit( 1 );
void print_vector(char *desc, lapack_int n, lapack_int *vec)
lapack_int LAPACKE_dgesv(int matrix_layout, lapack_int n, lapack_int nrhs, double *a, lapack_int lda, lapack_int *ipiv, double *b, lapack_int ldb)
void print_matrix_colmajor(char *desc, lapack_int m, lapack_int n, double *mat, lapack_int ldm)
int main(int argc, char **argv)