LAPACK  3.5.0
LAPACK: Linear Algebra PACKage
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

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

Function Documentation

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

Definition at line 66 of file example_DGELS_colmajor.c.

67 {
68  /* Locals */
69  double A[5][3] = {1,2,3,4,5,1,3,5,2,4,1,4,2,5,3};
70  double b[5][2] = {-10,12,14,16,18,-3,14,12,16,16};
71  lapack_int info,m,n,lda,ldb,nrhs;
72  int i,j;
73 
74  /* Initialization */
75  m = 5;
76  n = 3;
77  nrhs = 2;
78  lda = 5;
79  ldb = 5;
80 
81  /* Print Entry Matrix */
82  print_matrix_colmajor( "Entry Matrix A", m, n, *A, lda );
83  /* Print Right Rand Side */
84  print_matrix_colmajor( "Right Hand Side b", n, nrhs, *b, ldb );
85  printf( "\n" );
86 
87  /* Executable statements */
88  printf( "LAPACKE_dgels (col-major, high-level) Example Program Results\n" );
89  /* Solve least squares problem*/
90  info = LAPACKE_dgels(LAPACK_COL_MAJOR,'N',m,n,nrhs,*A,lda,*b,ldb);
91 
92  /* Print Solution */
93  print_matrix_colmajor( "Solution", n, nrhs, *b, ldb );
94  printf( "\n" );
95  exit( 0 );
96 } /* End of LAPACKE_dgels Example */
lapack_int LAPACKE_dgels(int matrix_order, 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:36
#define LAPACK_COL_MAJOR
Definition: lapacke.h:120
void print_matrix_colmajor(char *desc, lapack_int m, lapack_int n, double *mat, lapack_int ldm)
#define lapack_int
Definition: lapacke.h:47

Here is the call graph for this function: