1 #include <flens/lapack/interface/include/config.h>
 2 #include <cxxblas/drivers/drivers.h>
 3 
 4 
 5 namespace flens { namespace lapack {
 6 
 7 extern "C" {
 8 
 9 //-- dtrtri --------------------------------------------------------------------
10 void
11 LAPACK_DECL(dtrtri)(const char       *UPLO,
12                     const char       *DIAG,
13                     const INTEGER    *N,
14                     DOUBLE           *A,
15                     const INTEGER    *LDA,
16                     INTEGER          *INFO)
17 {
18     DEBUG_FLENS_LAPACK("dgetri");
19     using std::max;
20     using std::min;
21 //
22 //  Test the input parameters so that we pass LAPACK error checks
23 //
24     *INFO = 0;
25     const bool upper  = (*UPLO=='U');
26     const bool noUnit = (*DIAG=='N');
27 
28     if (!upper && *UPLO!='L') {
29         *INFO = 1;
30     } else if (!noUnit && *DIAG!='U') {
31         *INFO = 2;
32     } else if (*N<0) {
33         *INFO = 3;
34     } else if (*LDA<max(INTEGER(1),*N)) {
35         *INFO = 5;
36     }
37 
38     if (*INFO!=0) {
39         LAPACK_ERROR("DTRTRI", INFO);
40         *INFO = -(*INFO);
41         return;
42     }
43 
44 //
45 //  Setup FLENS matrix/vector types
46 //
47     StorageUpLo    upLo = cxxblas::getCxxBlasEnum<StorageUpLo>(*UPLO);
48     Diag           diag = cxxblas::getCxxBlasEnum<Diag>(*DIAG);
49 
50     DTrMatrixView  _A(DFSView(*N, *N, A, *LDA), upLo, diag);
51 
52 //
53 //  Call FLENS implementation
54 //
55     tri(_A);
56 }
57 
58 // extern "C"
59 
60 } } // namespace lapack, flens