outer - generalized outer product
arr1.outer(op,
arr2)
The outer() method computes the generalized
outer product of arr1 and arr2 using the operator or
function op. The resulting array has a shape that is the
concatenation of the shapes of arr1 and arr2.
This is similar to APL
arr0 ∘. op
arr1.
For each element i in arr1 and j in arr2, the result contains the result of applying op(i, j).
An array containing the results of applying op to all combinations of elements from the input arrays.
ArgCheck if the number of arguments is not 3.
TypeCheck if op is not an operator or
procedure.
a = [2, 3]
b = [3, 4, 5]
a.outer(`*, b)
6 8 10
9 12 15