[genius] Thu Dec 10 17:00:49 2009 Jiri (George) Lebl <jirka 5z com>



commit d9639dbd225bd1e424b0b93b9df83aebaa04c92b
Author: Jiri (George) Lebl <jirka 5z com>
Date:   Thu Dec 10 17:00:53 2009 -0600

    Thu Dec 10 17:00:49 2009  Jiri (George) Lebl <jirka 5z com>
    
    	* src/eval.c: fix matrix expansion.  After zeros were replaced
    	  the expression [0,I(2);0,0] would not include the last row.  This
    	  fixes AuxilliaryUnitMatrix and JordanBlock functions.
    
    	* src/geniustests.txt: add some tests for matrix expansion and the
    	  above functions

 ChangeLog           |    9 +++++++++
 src/eval.c          |   13 ++++---------
 src/geniustests.txt |   10 ++++++++++
 3 files changed, 23 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 21b0f9c..138aa05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Thu Dec 10 17:00:49 2009  Jiri (George) Lebl <jirka 5z com>
+
+	* src/eval.c: fix matrix expansion.  After zeros were replaced
+	  the expression [0,I(2);0,0] would not include the last row.  This
+	  fixes AuxilliaryUnitMatrix and JordanBlock functions.
+
+	* src/geniustests.txt: add some tests for matrix expansion and the
+	  above functions
+
 Tue Nov 10 00:30:53 2009  Jiri (George) Lebl <jirka 5z com>
 
 	* Release 1.0.8
diff --git a/src/eval.c b/src/eval.c
index 031bc68..c78a10c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -940,13 +940,7 @@ expand_row (GelMatrix *dest, GelMatrixW *src, int di, int si, gboolean *need_col
 {
 	int i;
 	int height = 0;
-	int roww;
-	
-	roww = 0;
-	for(i=0;i<gel_matrixw_width(src);i++) {
-		if(!gel_matrixw_get_index(src,i,si)) continue;
-		roww = i+1;
-	}
+	int roww = gel_matrixw_width(src);
 
 	for(i=0;i<roww;i++) {
 		GelETree *et = gel_matrixw_get_index(src,i,si);
@@ -1208,9 +1202,9 @@ gel_expandmatrix (GelETree *n)
 
 	m = gel_matrix_new();
 	gel_matrix_set_size(m, w, h, TRUE /* padding */);
-	
+
 	cols = gel_matrixw_width (nm);
-	
+
 	for (i = 0, k = 0; i < h; i++) {
 		int w;
 		w = expand_row (m, nm, k, i, &need_colwise);
@@ -1266,6 +1260,7 @@ gel_expandmatrix (GelETree *n)
 			tm = gel_matrix_new ();
 
 			gel_matrix_set_size (tm,cols,m->height, TRUE /* padding */);
+
 			for (i = 0, ii = 0; i < m->width; ii += colwidths[i], i++) {
 				if (colwidths[i] > 0) {
 					expand_col (tm, m, i, ii, colwidths[i]);
diff --git a/src/geniustests.txt b/src/geniustests.txt
index fed41e7..7b59381 100644
--- a/src/geniustests.txt
+++ b/src/geniustests.txt
@@ -969,6 +969,16 @@ Limit(UnitStep,-1)						0
 Limit (cos,pi)							-1.0
 round(100*InfiniteSum(`(n)=2^(-n),1,1))				100
 func=1;start=2;inc=3;round(100*InfiniteSum(`(n)=inc-func-start+2^(-n),1,1))	100
+[0,I(2);0,0]							[0,1,0;0,0,1;0,0,0]
+[0,I(2);0]							[0,1,0;0,0,1;0,0,0]
+[0,I(2);null;1,2,3]						[0,1,0,0;0,0,1,0;1,2,2,3]
+[0,I(2);null;0,0,0]						[0,1,0,0;0,0,1,0;0,0,0,0]
+AuxilliaryUnitMatrix(3)						[0,1,0;0,0,1;0,0,0]
+AuxilliaryUnitMatrix(4)						[0,1,0,0;0,0,1,0;0,0,0,1;0,0,0,0]
+J(4,2)								[2,1,0,0;0,2,1,0;0,0,2,1;0,0,0,2]
+J(10,0)==AuxilliaryUnitMatrix (10)				true
+[1,2,3;4,5;6]							[1,2,3;4,5,0;6,0,0]
+a=[1,2,3;4,5,6;7,8,9];[a,10;11,12]				[1,2,3,10;4,5,6,10;7,8,9,10;11,11,11,12]
 load "nullspacetest.gel"					true
 load "longtest.gel"						true
 load "testprec.gel"						true



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