diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-11-03 22:03:12 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-11-03 22:03:12 +0100 |
commit | fd88d721d2327e92a8c6c156dde266967dfb0d91 (patch) | |
tree | 4aca8c505d28ebc405c6e4dd5f8c9889105361d4 /blas/common.h | |
parent | a8fb6b0ad33a4620424e31e842b54c8cd255c6d2 (diff) |
implement proper error handling in level 3 routines
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> |