JLFloat32VectorFunctions2ΒΆ
jarray32.spad line 170 [edit on github]
This package provides operations which all take as arguments JLFloat32Vector and functions from JLFloat32 to JLFloat32. The operations all iterate over their vector argument and either return a value of type JLFloat32Vector or a JLFloat32.
- map: (JLFloat32 -> JLFloat32, JLFloat32Vector) -> JLFloat32Vector
map(f, v)applies the functionfto every element of the vectorvproducing a new vector containing the values.
- map: (JLFloat32 -> Union(JLFloat32, failed), JLFloat32Vector) -> Union(JLFloat32Vector, failed)
map(f, v)applies the functionfto every element of the vectorvproducing a new vector containing the values or"failed".
- reduce: ((JLFloat32, JLFloat32) -> JLFloat32, JLFloat32Vector, JLFloat32) -> JLFloat32
reduce(func, vec, ident)combines the elements invecusing the binary functionfunc. Argument ident is returned ifvecis empty.
- scan: ((JLFloat32, JLFloat32) -> JLFloat32, JLFloat32Vector, JLFloat32) -> JLFloat32Vector
scan(func, vec, ident)creates a new vector whose elements are the result of applying reduce to the binary functionfunc, increasing initial subsequences of the vectorvec, and the element ident.