about summary refs log tree commit diff
path: root/src/debug.h
diff options
context:
space:
mode:
authorPjotr Prins2017-08-22 07:56:07 +0000
committerPjotr Prins2017-08-22 08:01:50 +0000
commit99527865c00b74a3a48daa2e1e5eb7c71bd861b5 (patch)
tree313f36729cc5f0e860d4c73f26ddbee5cff0bf4f /src/debug.h
parentc7cbd8b2d5a06b7b86733719315f9da1638cb32e (diff)
downloadpangemma-99527865c00b74a3a48daa2e1e5eb7c71bd861b5.tar.gz
Fixes matrix checks - looking saner now
- Matrix checks as described in https://github.com/genetics-statistics/GEMMA/issues/72
- introduces -strict switch which will exit on certain conditions
- zero small eigenvalues in EigenDecomp_Zeroed which also checks for negative values
- commented out float versions of functions in lapack.cpp (pre-removal)
- reverted on disabled regression tests (GEMMA shows its previous behaviour now)
Diffstat (limited to 'src/debug.h')
-rw-r--r--src/debug.h15
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