aboutsummaryrefslogtreecommitdiff
path: root/src/gensvm_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gensvm_debug.c')
-rw-r--r--src/gensvm_debug.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/gensvm_debug.c b/src/gensvm_debug.c
new file mode 100644
index 0000000..d94711a
--- /dev/null
+++ b/src/gensvm_debug.c
@@ -0,0 +1,34 @@
+/**
+ * @file gensvm_debug.c
+ * @author Gertjan van den Burg
+ * @date May, 2016
+ * @brief Functions facilitating debugging
+ *
+ * @details
+ * Defines functions useful for debugging matrices.
+ *
+ */
+
+#include "gensvm_debug.h"
+
+/**
+ * @brief print a matrix
+ *
+ * @details
+ * Debug function to print a matrix
+ *
+ * @param[in] M matrix
+ * @param[in] rows number of rows of M
+ * @param[in] cols number of columns of M
+ */
+void print_matrix(double *M, long rows, long cols)
+{
+ long i, j;
+
+ for (i=0; i<rows; i++) {
+ for (j=0; j<cols; j++)
+ note("%+6.6f ", matrix_get(M, cols, i, j));
+ note("\n");
+ }
+ note("\n");
+}