aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--include/gensvm_debug.h2
-rw-r--r--src/gensvm_debug.c9
3 files changed, 9 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index ab30f6a..167b33f 100644
--- a/Makefile
+++ b/Makefile
@@ -48,6 +48,7 @@ lib/libgensvm.a: \
src/gensvm_cmdarg.o \
src/gensvm_copy.o \
src/gensvm_cv_util.o \
+ src/gensvm_debug.o \
src/gensvm_grid.o \
src/gensvm_gridsearch.o \
src/gensvm_init.o \
@@ -69,6 +70,7 @@ lib/libgensvm.a: \
src/gensvm_cmdarg.o \
src/gensvm_copy.o \
src/gensvm_cv_util.o \
+ src/gensvm_debug.o \
src/gensvm_grid.o \
src/gensvm_gridsearch.o \
src/gensvm_init.o \
diff --git a/include/gensvm_debug.h b/include/gensvm_debug.h
index 1cab4ca..d95d0eb 100644
--- a/include/gensvm_debug.h
+++ b/include/gensvm_debug.h
@@ -15,6 +15,6 @@
#include "gensvm_print.h"
-void print_matrix(double *M, long rows, long cols);
+void gensvm_print_matrix(double *M, long rows, long cols);
#endif
diff --git a/src/gensvm_debug.c b/src/gensvm_debug.c
index d94711a..f4b4151 100644
--- a/src/gensvm_debug.c
+++ b/src/gensvm_debug.c
@@ -21,13 +21,16 @@
* @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)
+void gensvm_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));
+ for (j=0; j<cols; j++) {
+ if (j > 0)
+ note(" ");
+ note("%+6.6f", matrix_get(M, cols, i, j));
+ }
note("\n");
}
note("\n");