[Gridflow-cvs] [svn] commit: r4079 - /trunk/gridflow.h

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Fri Sep 19 17:09:54 EDT 2008


Author: matju
Date: Fri Sep 19 17:09:54 2008
New Revision: 4079

Log:
start also can be negative (that is, counting from the end)

Modified:
    trunk/gridflow.h

Modified: trunk/gridflow.h
==============================================================================
--- trunk/gridflow.h (original)
+++ trunk/gridflow.h Fri Sep 19 17:09:54 2008
@@ -364,7 +364,8 @@
 	Card get(Card i) {return v[i];}
 /*	Dim *range(Card i, Card j) {return new Dim(...);} */
 	Card prod(Card start=0, Card end=-1) {
-		if (end<0) end+=n;
+		if (start<0) start+=n;
+		if (end  <0) end  +=n;
 		Card tot=1;
 		for (Card i=start; i<=end; i++) tot *= v[i];
 		return tot;



More information about the Gridflow-cvs mailing list