/* * call-seq: * dvector.collect {|x| block } -> a_dvector * dvector.map {|x| block } -> a_dvector * * Invokes <i>block</i> once for each element of _dvector_. Returns a new vector holding the values returned by _block_. * Note that for numeric operations on long vectors, it is more efficient to * apply the operator directly to the vector rather than using map or collect. * * a = Dvector[ 1, 2, 3, 4 ] * a.map {|x| x**2 + 1 } -> Dvector[ 2, 5, 10, 17 ] * A better way: * a = Dvector[ 1, 2, 3, 4 ] * a**2 + 1 -> Dvector[ 2, 5, 10, 17 ] */ VALUE dvector_collect(VALUE ary) {