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 //-- dtrtrs --------------------------------------------------------------------
16 void
17 LAPACK_DECL(dtrtrs)(const char *UPLO,
18 const char *TRANS,
19 const char *DIAG,
20 const INTEGER *N,
21 const INTEGER *NRHS,
22 const DOUBLE *A,
23 const INTEGER *LDA,
24 DOUBLE *B,
25 const INTEGER *LDB,
26 INTEGER *INFO)
27 {
28 DEBUG_FLENS_LAPACK("dtrtrs");
29 std::cerr << "calling my dtrtrs!" << std::endl;
30 //
31 // Test the input parameters so that we pass LAPACK error checks
32 //
33 *INFO = 0;
34
35 if (*UPLO!='U' && *UPLO!='L') {
36 *INFO = -1;
37 } else if (*TRANS!='N' && *TRANS!='C' && *TRANS!='T') {
38 *INFO = -2;
39 } else if (*DIAG!='N' && *DIAG!='U') {
40 *INFO = -3;
41 } else if (*N<0) {
42 *INFO = -4;
43 } else if (*NRHS<0) {
44 *INFO = -5;
45 } else if (*LDA<std::max(INTEGER(1), *N)) {
46 *INFO = -7;
47 } else if (*LDB<std::max(INTEGER(1), *N)) {
48 *INFO = -9;
49 }
50 if (*INFO!=0) {
51 *INFO = -(*INFO);
52 LAPACK_ERROR("DTRTRS", INFO);
53 *INFO = -(*INFO);
54 return;
55 }
56 //
57 // Call FLENS implementation
58 //
59 /*
60 StorageUpLo upLo = cxxblas::getCxxBlasEnum<StorageUpLo>(*UPLO);
61 Transpose trans = cxxblas::getCxxBlasEnum<Transpose>(*TRANS);
62 Diag diag = cxxblas::getCxxBlasEnum<Diag>(*DIAG);
63 DConstTrMatrixView _A(DConstFSView(*N, *N, A, *LDA), upLo, diag);
64 DGeMatrixView _B = DFSView(*N, *NRHS, B, *LDB);
65
66 trs(trans, _A, _B);
67 */
68 LAPACK_IMPL(dtrtrs)(UPLO,
69 TRANS,
70 DIAG,
71 N,
72 NRHS,
73 A,
74 LDA,
75 B,
76 LDB,
77 INFO);
78
79 }
80
81 } // extern "C"
82
83 } } // namespace lapack, flens
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 //-- dtrtrs --------------------------------------------------------------------
16 void
17 LAPACK_DECL(dtrtrs)(const char *UPLO,
18 const char *TRANS,
19 const char *DIAG,
20 const INTEGER *N,
21 const INTEGER *NRHS,
22 const DOUBLE *A,
23 const INTEGER *LDA,
24 DOUBLE *B,
25 const INTEGER *LDB,
26 INTEGER *INFO)
27 {
28 DEBUG_FLENS_LAPACK("dtrtrs");
29 std::cerr << "calling my dtrtrs!" << std::endl;
30 //
31 // Test the input parameters so that we pass LAPACK error checks
32 //
33 *INFO = 0;
34
35 if (*UPLO!='U' && *UPLO!='L') {
36 *INFO = -1;
37 } else if (*TRANS!='N' && *TRANS!='C' && *TRANS!='T') {
38 *INFO = -2;
39 } else if (*DIAG!='N' && *DIAG!='U') {
40 *INFO = -3;
41 } else if (*N<0) {
42 *INFO = -4;
43 } else if (*NRHS<0) {
44 *INFO = -5;
45 } else if (*LDA<std::max(INTEGER(1), *N)) {
46 *INFO = -7;
47 } else if (*LDB<std::max(INTEGER(1), *N)) {
48 *INFO = -9;
49 }
50 if (*INFO!=0) {
51 *INFO = -(*INFO);
52 LAPACK_ERROR("DTRTRS", INFO);
53 *INFO = -(*INFO);
54 return;
55 }
56 //
57 // Call FLENS implementation
58 //
59 /*
60 StorageUpLo upLo = cxxblas::getCxxBlasEnum<StorageUpLo>(*UPLO);
61 Transpose trans = cxxblas::getCxxBlasEnum<Transpose>(*TRANS);
62 Diag diag = cxxblas::getCxxBlasEnum<Diag>(*DIAG);
63 DConstTrMatrixView _A(DConstFSView(*N, *N, A, *LDA), upLo, diag);
64 DGeMatrixView _B = DFSView(*N, *NRHS, B, *LDB);
65
66 trs(trans, _A, _B);
67 */
68 LAPACK_IMPL(dtrtrs)(UPLO,
69 TRANS,
70 DIAG,
71 N,
72 NRHS,
73 A,
74 LDA,
75 B,
76 LDB,
77 INFO);
78
79 }
80
81 } // extern "C"
82
83 } } // namespace lapack, flens