LAPACK 3.11.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ main()

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

Definition at line 64 of file example_DGELS_colmajor.c.

65{
66 /* Locals */
67 double A[5][3] = {{1,2,3},{4,5,1},{3,5,2},{4,1,4},{2,5,3}};
68 double b[5][2] = {{-10,12},{14,16},{18,-3},{14,12},{16,16}};
69 lapack_int info,m,n,lda,ldb,nrhs;
70
71 /* Initialization */
72 m = 5;
73 n = 3;
74 nrhs = 2;
75 lda = 5;
76 ldb = 5;
77
78 /* Print Entry Matrix */
79 print_matrix_colmajor( "Entry Matrix A", m, n, *A, lda );
80 /* Print Right Rand Side */
81 print_matrix_colmajor( "Right Hand Side b", n, nrhs, *b, ldb );
82 printf( "\n" );
83
84 /* Executable statements */
85 printf( "LAPACKE_dgels (col-major, high-level) Example Program Results\n" );
86 /* Solve least squares problem*/
87 info = LAPACKE_dgels(LAPACK_COL_MAJOR,'N',m,n,nrhs,*A,lda,*b,ldb);
88
89 /* Print Solution */
90 print_matrix_colmajor( "Solution", n, nrhs, *b, ldb );
91 printf( "\n" );
92 exit( info );
93} /* End of LAPACKE_dgels Example */
#define lapack_int
Definition: lapack.h:87
#define LAPACK_COL_MAJOR
Definition: lapacke.h:53
lapack_int LAPACKE_dgels(int matrix_layout, char trans, lapack_int m, lapack_int n, lapack_int nrhs, double *a, lapack_int lda, double *b, lapack_int ldb)
Definition: lapacke_dgels.c:35
void print_matrix_colmajor(char *desc, lapack_int m, lapack_int n, double *mat, lapack_int ldm)
Here is the call graph for this function: