1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
#include <flens/lapack/interface/include/config.h>
namespace flens { namespace lapack { extern "C" { //-- dtrtri -------------------------------------------------------------------- void LAPACK_DECL(dtrtri)(const char *UPLO, const char *DIAG, const INTEGER *N, DOUBLE *A, const INTEGER *LDA, INTEGER *INFO) { using std::max; using std::min; // // Test the input parameters so that we pass LAPACK error checks // *INFO = 0; const bool upper = (*UPLO=='U'); const bool noUnit = (*DIAG=='N'); if (!upper && *UPLO!='L') { *INFO = 1; } else if (!noUnit && *DIAG!='U') { *INFO = 2; } else if (*N<0) { *INFO = 3; } else if (*LDA<max(INTEGER(1),*N)) { *INFO = 5; } if (*INFO!=0) { LAPACK_ERROR("DTRTRI", INFO); *INFO = -(*INFO); return; } // // Setup FLENS matrix/vector types // StorageUpLo upLo = cxxblas::getCxxBlasEnum<StorageUpLo>(*UPLO); Diag diag = cxxblas::getCxxBlasEnum<Diag>(*DIAG); DTrMatrixView _A(DFSView(*N, *N, A, *LDA), upLo, diag); // // Call FLENS implementation // tri(_A); } //-- ztrtri -------------------------------------------------------------------- void LAPACK_DECL(ztrtri)(const char *UPLO, const char *DIAG, const INTEGER *N, DOUBLE_COMPLEX *A, const INTEGER *LDA, INTEGER *INFO) { using std::max; using std::min; // // Test the input parameters so that we pass LAPACK error checks // *INFO = 0; const bool upper = (*UPLO=='U'); const bool noUnit = (*DIAG=='N'); if (!upper && *UPLO!='L') { *INFO = 1; } else if (!noUnit && *DIAG!='U') { *INFO = 2; } else if (*N<0) { *INFO = 3; } else if (*LDA<max(INTEGER(1),*N)) { *INFO = 5; } if (*INFO!=0) { LAPACK_ERROR("ZTRTRI", INFO); *INFO = -(*INFO); return; } // // Setup FLENS matrix/vector types // StorageUpLo upLo = cxxblas::getCxxBlasEnum<StorageUpLo>(*UPLO); Diag diag = cxxblas::getCxxBlasEnum<Diag>(*DIAG); auto zA = reinterpret_cast<CXX_DOUBLE_COMPLEX *>(A); ZTrMatrixView _A(ZFSView(*N, *N, zA, *LDA), upLo, diag); // // Call FLENS implementation // tri(_A); } } // extern "C" } } // namespace lapack, flens |