math:vector-sum

(math:vector-sum v [slice])


Description:

Returns the sum of elements in v.  can use a slice which wil return the sum of the slice. Any vectors must contain real numbers only


Arguments:

          slice -- slice v1 into segments.  slice is a list of (startpos size increment) or a list containing a single mask.  a mask is a vector of 0.0 or 1.0 values.

             v1 -- vector


Returns: real


Examples:

(math:vector-sum (vector 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0))          => 45.0

(math:vector-sum (vector 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0) '(0 3 2)) => 9.0



Back to index