JLVectorFunctions2(A, B)ΒΆ
jobject.spad line 1766 [edit on github]
A: JLObjectRing
B: JLObjectRing
This package provides operations which all take as arguments Julia vectors of elements of some type A and functions from A to another of type B. The operations all iterate over their vector argument and either return a value of type B or a vector over B.
- map: (A -> B, JLVector A) -> JLVector B
map(f, v)applies the functionfto every element of the vectorvproducing a new vector containing the values.
- map: (A -> Union(B, failed), JLVector A) -> Union(JLVector B, failed)
map(f, v)applies the functionfto every element of the vectorvproducing a new vector containing the values or"failed".
- reduce: ((A, B) -> B, JLVector A, B) -> B
reduce(func, vec, ident)combines the elements invecusing the binary functionfunc. Argument ident is returned ifvecis empty.