LAPACK  3.5.0
LAPACK: Linear Algebra PACKage
 All Classes Files Functions Variables Typedefs Macros
example_DGELS_colmajor.c File Reference
#include <stdio.h>
#include <lapacke.h>
#include "lapacke_example_aux.h"
Include dependency graph for example_DGELS_colmajor.c:

Go to the source code of this file.

Functions/Subroutines

int main (int argc, const char *argv[])

Function/Subroutine Documentation

int main ( int  argc,
const char *  argv[] 
)

Definition at line 66 of file example_DGELS_colmajor.c.

{
/* Locals */
double A[5][3] = {1,2,3,4,5,1,3,5,2,4,1,4,2,5,3};
double b[5][2] = {-10,12,14,16,18,-3,14,12,16,16};
lapack_int info,m,n,lda,ldb,nrhs;
int i,j;
/* Initialization */
m = 5;
n = 3;
nrhs = 2;
lda = 5;
ldb = 5;
/* Print Entry Matrix */
print_matrix_colmajor( "Entry Matrix A", m, n, *A, lda );
/* Print Right Rand Side */
print_matrix_colmajor( "Right Hand Side b", n, nrhs, *b, ldb );
printf( "\n" );
/* Executable statements */
printf( "LAPACKE_dgels (col-major, high-level) Example Program Results\n" );
/* Solve least squares problem*/
info = LAPACKE_dgels(LAPACK_COL_MAJOR,'N',m,n,nrhs,*A,lda,*b,ldb);
/* Print Solution */
print_matrix_colmajor( "Solution", n, nrhs, *b, ldb );
printf( "\n" );
exit( 0 );
} /* End of LAPACKE_dgels Example */

Here is the call graph for this function: