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 //-- dgetrs --------------------------------------------------------------------
16 void
17 LAPACK_DECL(dgetrs)(const char       *TRANS,
18                     const INTEGER    *N,
19                     const INTEGER    *NRHS,
20                     const DOUBLE     *A,
21                     const INTEGER    *LDA,
22                     const INTEGER    *IPIV,
23                     DOUBLE           *B,
24                     const INTEGER    *LDB,
25                     INTEGER          *INFO)
26 {
27     DEBUG_FLENS_LAPACK("dgetrs");
28 //
29 //  Test the input parameters so that we pass LAPACK error checks
30 //
31     *INFO = 0;
32     if (*TRANS!='N' && *TRANS!='T' && *TRANS!='C') {
33         *INFO = -1;
34     } else if (*N<0) {
35         *INFO = -2;
36     } else if (*NRHS<0) {
37         *INFO = -3;
38     } else if (*LDA<std::max(INTEGER(1), *N)) {
39         *INFO = -5;
40     } else if (*LDB<std::max(INTEGER(1), *N)) {
41         *INFO = -8;
42     }
43     if (*INFO!=0) {
44         *INFO = -(*INFO);
45         LAPACK_ERROR("DGETRS", INFO);
46         *INFO = -(*INFO);
47         return;
48     }
49 //
50 //  Call FLENS implementation
51 //
52     Transpose              trans  = getFlensLapackEnum<Transpose>(*TRANS);
53     DConstGeMatrixView     _A     = DConstFSView(*N, *N, A, *LDA);
54     IConstDenseVectorView  _IPIV  = IConstArrayView(*N, IPIV, 1);
55     DGeMatrixView          _B     = DFSView(*N, *NRHS, B, *LDB);
56 
57     trs(trans, _A, _IPIV, _B);
58 }
59 
60 // extern "C"
61 
62 } } // namespace lapack, flens