diff options
Diffstat (limited to 'blas/common.h')
-rw-r--r-- | blas/common.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/blas/common.h b/blas/common.h index c91cdc9a1..d56815ce3 100644 --- a/blas/common.h +++ b/blas/common.h @@ -56,22 +56,40 @@ extern "C" #define NUNIT 0 #define UNIT 1 +#define INVALID 0xff + #define OP(X) ( ((X)=='N' || (X)=='n') ? NOTR \ : ((X)=='T' || (X)=='t') ? TR \ : ((X)=='C' || (X)=='c') ? ADJ \ - : 0xff) + : INVALID) #define SIDE(X) ( ((X)=='L' || (X)=='l') ? LEFT \ : ((X)=='R' || (X)=='r') ? RIGHT \ - : 0xff) + : INVALID) #define UPLO(X) ( ((X)=='U' || (X)=='u') ? UP \ : ((X)=='L' || (X)=='l') ? LO \ - : 0xff) + : INVALID) #define DIAG(X) ( ((X)=='N' || (X)=='N') ? NUNIT \ : ((X)=='U' || (X)=='u') ? UNIT \ - : 0xff) + : INVALID) + + +inline bool check_op(const char* op) +{ + return OP(*op)!=0xff; +} + +inline bool check_side(const char* side) +{ + return SIDE(*side)!=0xff; +} + +inline bool check_uplo(const char* uplo) +{ + return UPLO(*uplo)!=0xff; +} #include <Eigen/Core> #include <Eigen/Jacobi> |