diff options
author | Peter Carbonetto | 2017-08-22 10:04:18 -0500 |
---|---|---|
committer | GitHub | 2017-08-22 10:04:18 -0500 |
commit | 2554242d10b9a7b58bd6c7df82a10e747b6cc0eb (patch) | |
tree | ef6a14e0f5d54c97f17aab9e28ddf464754372d7 /src/debug.h | |
parent | c7cbd8b2d5a06b7b86733719315f9da1638cb32e (diff) | |
parent | 48da44bf2da05f76008b083923ddf5701b9c029a (diff) | |
download | pangemma-2554242d10b9a7b58bd6c7df82a10e747b6cc0eb.tar.gz |
Merge pull request #76 from genenetwork/merge-checkK
Fixes matrix checks---looking saner now.
Diffstat (limited to 'src/debug.h')
-rw-r--r-- | src/debug.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/debug.h b/src/debug.h index 82dd245..f47cb4c 100644 --- a/src/debug.h +++ b/src/debug.h @@ -12,16 +12,21 @@ void gemma_gsl_error_handler (const char * reason, // Validation routines -void do_validate_K(const gsl_matrix *K, bool do_check, const char *__file, int __line); +void do_validate_K(const gsl_matrix *K, bool do_check, bool strict, const char *__file, int __line); #define ROUND(f) round(f * 10000.)/10000 -#define validate_K(K,check) do_validate_K(K,check,__FILE__,__LINE__) +#define validate_K(K,check,strict) do_validate_K(K,check,strict,__FILE__,__LINE__) #define warning_at_msg(__file,__line,msg) cerr << "**** WARNING: " << msg << " in " << __file << " at line " << __line << endl; -inline void fail_at_msg(const char *__file, int __line, const char *msg) { - std::cerr << "**** FAIL: " << msg << " in " << __file << " at line " << __line << std::endl; - exit(1); +inline void fail_at_msg(bool strict, const char *__file, int __line, const char *msg) { + if (strict) + std::cerr << "**** STRICT FAIL: "; + else + std::cerr << "**** WARNING: "; + std::cerr << msg << " in " << __file << " at line " << __line << std::endl; + if (strict) + exit(1); } #if defined NDEBUG |