[Gridflow-cvs] [svn] commit: r3932 - in /trunk: optional/opencv.c tests/cv.SVD-test.pd

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Wed Jun 25 12:00:05 EDT 2008


Author: matju
Date: Wed Jun 25 11:59:59 2008
New Revision: 3932

Log:
fixed [cv.SVD] by adding 3rd outlet (the 3rd matrix isn't just the inverse or transpose of the 2nd)

Modified:
    trunk/optional/opencv.c
    trunk/tests/cv.SVD-test.pd

Modified: trunk/optional/opencv.c
==============================================================================
--- trunk/optional/opencv.c (original)
+++ trunk/optional/opencv.c Wed Jun 25 11:59:59 2008
@@ -141,13 +141,11 @@
 	if (!in->dim->equal(r->dim)) RAISE("dimension mismatch: left:%s right:%s",in->dim->to_s(),r->dim->to_s());
 	in->set_chunk(0);
 } GRID_FLOW {
-	//post("l=%p, r=%p", &*l, &*r);
 	PtrGrid l = new Grid(in->dim,(T *)data);
 	PtrGrid o = new Grid(in->dim,in->nt);
 	CvArr *a = cvGrid(l,mode);
 	CvArr *b = cvGrid(r,mode);
 	CvArr *c = cvGrid(o,mode);
-	//post("a=%p, b=%p", a, b);
 	func(a,b,c);
 	out = new GridOutlet(this,0,in->dim,in->nt);
 	out->send(o->dim->prod(),(T *)o->data);
@@ -199,14 +197,17 @@
 	PtrGrid l = new Grid(in->dim,(T *)data);
 	PtrGrid o0 = new Grid(in->dim,in->nt);
 	PtrGrid o1 = new Grid(in->dim,in->nt);
+	PtrGrid o2 = new Grid(in->dim,in->nt);
 	CvArr *a = cvGrid(l,mode);
 	CvArr *c0 = cvGrid(o0,mode);
 	CvArr *c1 = cvGrid(o1,mode);
-	cvSVD(a,c0,c1);
+	CvArr *c2 = cvGrid(o2,mode);
+	cvSVD(a,c0,c1,c2);
+	(new GridOutlet(this,2,in->dim,in->nt))->send(o2->dim->prod(),(T *)o2->data);
 	(new GridOutlet(this,1,in->dim,in->nt))->send(o1->dim->prod(),(T *)o1->data);
 	(new GridOutlet(this,0,in->dim,in->nt))->send(o0->dim->prod(),(T *)o0->data);
 } GRID_END
-\end class {install("cv.SVD",1,2);}
+\end class {install("cv.SVD",1,3);}
 
 \class CvSplit : CvOp1 {
 	int channels;

Modified: trunk/tests/cv.SVD-test.pd
==============================================================================
--- trunk/tests/cv.SVD-test.pd (original)
+++ trunk/tests/cv.SVD-test.pd Wed Jun 25 11:59:59 2008
@@ -8,20 +8,20 @@
 #X obj 48 86 #redim (2 2);
 #X msg 160 33 4 f # 2 3 5 7;
 #X obj 48 67 #pack 4 f;
-#X obj 94 105 cv.Invert;
-#X obj 309 48 display;
-#X obj 309 95 display;
-#X obj 168 95 display;
+#X obj 161 191 display;
+#X obj 12 185 display;
 #X obj 48 280 #inner \, seed (f #);
 #X obj 178 280 #inner \, seed (f #);
 #X obj 48 261 #store;
 #X obj 48 238 #finished;
 #X obj 48 145 t a a;
-#X connect 0 0 12 0;
-#X connect 0 0 17 0;
+#X obj 307 189 display;
+#X connect 0 0 10 0;
+#X connect 0 0 15 0;
 #X connect 0 1 9 0;
-#X connect 0 1 11 0;
-#X connect 0 1 14 1;
+#X connect 0 1 13 1;
+#X connect 0 2 16 0;
+#X connect 0 2 12 1;
 #X connect 2 0 8 0;
 #X connect 3 0 8 1;
 #X connect 4 0 8 2;
@@ -29,11 +29,9 @@
 #X connect 6 0 0 0;
 #X connect 7 0 6 0;
 #X connect 8 0 6 0;
-#X connect 9 0 10 0;
-#X connect 9 0 15 1;
-#X connect 13 0 1 0;
-#X connect 14 0 13 1;
-#X connect 15 0 13 0;
-#X connect 16 0 15 0;
-#X connect 17 0 16 0;
-#X connect 17 1 14 0;
+#X connect 11 0 1 0;
+#X connect 12 0 11 1;
+#X connect 13 0 11 0;
+#X connect 14 0 13 0;
+#X connect 15 0 14 0;
+#X connect 15 1 12 0;



More information about the Gridflow-cvs mailing list