1 //#define CXXBLAS_DEBUG_OUT(x)      std::cerr << x << std::endl;
 2 
 3 #define STR(x)      #x
 4 #define STRING(x)   STR(x)
 5 
 6 #define FLENS_DEFAULT_INDEXTYPE int
 7 
 8 #include <flens/lapack/interface/include/config.h>
 9 
10 
11 namespace flens { namespace lapack {
12 
13 extern "C" {
14 
15 //-- dgetrf --------------------------------------------------------------------
16 void
17 LAPACK_DECL(dgetrf)(const INTEGER    *M,
18                     const INTEGER    *N,
19                     DOUBLE           *A,
20                     const INTEGER    *LDA,
21                     INTEGER          *IPIV,
22                     INTEGER          *INFO)
23 {
24     DEBUG_FLENS_LAPACK("dgetrf");
25 //
26 //  Test the input parameters so that we pass LAPACK error checks
27 //
28     *INFO = 0;
29     if (*M<0) {
30         *INFO = -1;
31     } else if (*N<0) {
32         *INFO = -2;
33     } else if (*LDA<std::max(INTEGER(1), *M)) {
34         *INFO = -4;
35     }
36     if (*INFO!=0) {
37         *INFO = -(*INFO);
38         LAPACK_ERROR("DGETRF", INFO);
39         *INFO = -(*INFO);
40         return;
41     }
42 //
43 //  Call FLENS implementation
44 //
45 
46     DGeMatrixView       _A      = DFSView(*M, *N, A, *LDA);
47     IDenseVectorView    _IPIV   = IArrayView(*M, IPIV, 1);
48 
49     *INFO = trf(_A, _IPIV);
50 }
51 
52 // extern "C"
53 
54 } } // namespace lapack, flens