hi list . .is there a object for mathematic basic operations on lists. . .? multiply(divide, add, substract) all elements of listA with listB . . .if possible the listlenght should be variable
a1 a2 a3 b1 b2 b3
a1*b1, a2*b2, a3*b3,
thanx nos
Hallo, noskule hat gesagt: // noskule wrote:
. .is there a object for mathematic basic operations on lists. . .? multiply(divide, add, substract) all elements of listA with listB . . .if possible the listlenght should be variable
a1 a2 a3 b1 b2 b3
a1*b1, a2*b2, a3*b3,
Maybe there is a simpler way, but I would probably try to do this with zexy's matrix objects. You can consider aX and bX as matrices with 1 dimension. Length is dynamic, but both vectors must match. See attached example.
Frank Barknecht _ ______footils.org__
On Fri, 27 Feb 2004, noskule wrote:
. .is there a object for mathematic basic operations on lists. . .? multiply(divide, add, substract) all elements of listA with listB . . .if possible the listlenght should be variable a1 a2 a3 b1 b2 b3 a1*b1, a2*b2, a3*b3,
GridFlow does this. Listlength is variable. All basic operations like that are in the [@] class, so you'd do [@ *] for multiplication. You can also do something like [@ * 3] for multiplication by the constant 3 (whatever the listlength is), and so on.
Since GridFlow converts to its own listlike datatype (called "grid") for improved performance, you have to convert it back using [@export_list].
It also can sum all elements in a list (using [@fold +]), and dozens of other operations.
Mathieu Bouchard http://artengine.ca/matju