Pharo-NDArray
Package for multidimensional arrays and common array programming language algorithms.
Example
NDArray withAll: 9 iota "Step 1"
:> reshape: #(3 3) "Step 2"
:> + 10 "Step 3"
:> reduce: #+ "Step 4"
:> asArray "Step 5"
Each step of the above code creates the following:
"Step 1:"
1 2 3 4 5 6 7 8 9
"Step 2"
1 2 3
4 5 6
7 8 9
"Step 3"
11 12 13
14 15 16
17 18 19
"Step 4"
36 45 54
"Step 5"
36 45 54 "Array (no longer NDArray)"
API
Adverbs
collect:
outerProduct:with:
reduce:
reduceFirst:
scan:
triangleProduct:
triangleProduct2:
upperProduct:
upperProduct2:
windowed:reduce:
Verbs (Scalar Monadic)
abs
ceiling
exp
factorial
floor
invFactorial
not
reciprocal
roll
sign
Verbs (Scalar Dyadic)
%
*
+
-
<
<=
>
>=
=
(to be removed)eq:
min:
max:
Verbs (Monadic)
all
any
asString
first
enlist
ints
invIota
invWhere
isEmpty
max
maxs
min
mins
mix
negated
ravel
reverse
size
split
sum
sums
transpose
unique
where
Verbs (Dyadic)
drop:
filter:
filterPred:
gather:
intersection:
matches:
memberOf:
notMatches:
partition:
reshape:
rotate:
take:
without:
Trains / Combinators
binaryAtop:with:with:
(blackbird)binaryFork:with:with:with:
(golden eagle)hook:with:
(starling)fork:with:with:
(phoenix)over:with:with:
(psi)