[Gridflow-cvs] [svn] commit: r5619 - /trunk/src/classes3.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Thu May 6 01:18:47 EDT 2010


Author: matju
Date: Thu May  6 01:18:47 2010
New Revision: 5619

Log:
save ram when [#lop_space]'s r.dim.prod==1

Modified:
    trunk/src/classes3.cxx

Modified: trunk/src/classes3.cxx
==============================================================================
--- trunk/src/classes3.cxx (original)
+++ trunk/src/classes3.cxx Thu May  6 01:18:47 2010
@@ -1362,10 +1362,11 @@
 	out = new GridOutlet(this,0,in.dim,in.nt);
 	in.set_chunk(w);
 	int sxc = in.dim.prod(w);
+	size_t rn = r->dim.prod();
+	if (rn==1) sxc=1; // fudge
 	r2 = new Grid(Dim(sxc),in.nt);
 	T *rdata = (T *)*r2;
-	size_t rn = r->dim.prod();
-	if (rn>1) for (int i=0; i<sxc; i++) rdata[i] = ((T *)*r)[mod(i,rn)];
+	for (int i=0; i<sxc; i++) rdata[i] = ((T *)*r)[mod(i,rn)];
 } GRID_FLOW {
 	int w = which_dim; if (w<0) w+=in.dim.n;
 	int sc = in.dim.prod(w+1);



More information about the Gridflow-cvs mailing list