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