[goffice] QR: fix debug code.



commit c2fece6c4b4af30ef0e1a5009e2b188697c2d0b9
Author: Morten Welinder <terra gnome org>
Date:   Tue Jan 8 16:16:54 2013 -0500

    QR: fix debug code.

 ChangeLog                    |    4 ++++
 goffice/math/go-regression.c |   15 ++++++++++++---
 2 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index afe3a41..3c66b77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-01-08  Morten Welinder  <terra gnome org>
+
+	* goffice/math/go-regression.c (QR): Fix debug code.
+
 2013-01-01  Morten Welinder  <terra gnome org>
 
 	* goffice/graph/gog-chart-map.c (polar_make_path_step): Remove
diff --git a/goffice/math/go-regression.c b/goffice/math/go-regression.c
index c2ebfb6..ce8afae 100644
--- a/goffice/math/go-regression.c
+++ b/goffice/math/go-regression.c
@@ -315,15 +315,24 @@ SUFFIX(QR) (CONSTMATRIX A, QMATRIX Q, QMATRIX R, int m, int n)
 		for (j = 0; j < n; j++)
 			SUFFIX(go_quad_init) (&Q[i][j], A[i][j]);
 
+#ifdef DEBUG_QR
+	for (i = 0; i < m; i++)
+		for (j = 0; j < m; j++)
+			SUFFIX(go_quad_init) (&R[i][j], -42);
+#endif
+
 	for (k = 0; k < m; k++) {
 		QUAD L;
 		int i;
 
 		SUFFIX(go_quad_dot_product) (&L, Q[k], Q[k], n);
 		SUFFIX(go_quad_sqrt) (&L, &L);
-#if 0
-		PRINT_MATRIX (Q, m, n);
-		g_printerr ("L[%d] = %20.15" FORMAT_g "\n", k, L);
+#ifdef DEBUG_QR
+		g_printerr ("Q:\n");
+		PRINT_QMATRIX (Q, m, n);
+		g_printerr ("\nR:\n");
+		PRINT_QMATRIX (R, m, m);
+		g_printerr ("L[%d] = %20.15" FORMAT_g "\n", k, SUFFIX(go_quad_value) (&L));
 #endif
 		if (SUFFIX(go_quad_value)(&L) == 0)
 			return GO_REG_singular;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]