array¶
fun matrix::qr()TBD
meth (A: any) !== (B: array): arrayReturns an array
Cwhere eachCᵥ := if A != Bᵥ then 1 else 0 end.meth (A: any) % (B: array): arrayReturns an array
Cwhere eachCᵥ := A % Bᵥ.let B := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2 % B :> <<0 0> <2 2>>
meth (A: any) * (B: array): arrayReturns an array
Cwhere eachCᵥ := A * Bᵥ.let B := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2 * B :> <<2 4> <6 8>>
meth (A: any) + (B: array): arrayReturns an array
Cwhere eachCᵥ := A + Bᵥ.let B := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2 + B :> <<3 4> <5 6>>
meth (A: any) - (B: array): arrayReturns an array
Cwhere eachCᵥ := A - Bᵥ.let B := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2 - B :> <<1 0> <-1 -2>>
meth (A: any) / (B: array): arrayReturns an array
Cwhere eachCᵥ := A / Bᵥ.let B := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2 / B :> <<2 1> <0.666667 0.5>>
meth (A: any) < (B: array): arrayReturns an array
Cwhere eachCᵥ := if A < Bᵥ then 1 else 0 end.meth (A: any) <= (B: array): arrayReturns an array
Cwhere eachCᵥ := if A <= Bᵥ then 1 else 0 end.meth (A: any) == (B: array): arrayReturns an array
Cwhere eachCᵥ := if A = Bᵥ then 1 else 0 end.meth (A: any) > (B: array): arrayReturns an array
Cwhere eachCᵥ := if A > Bᵥ then 1 else 0 end.meth (A: any) >= (B: array): arrayReturns an array
Cwhere eachCᵥ := if A >= Bᵥ then 1 else 0 end.type array < address, sequenceBase type for multidimensional arrays.
fun array(List: list): arrayReturns a new array containing the values in
List. The shape and type of the array is determined from the elements inList.fun array::hcat(Array₁: array, ...): arrayReturns a new array with the values of
Array₁, ..., Arrayₙconcatenated along the last dimension.let A := $[[1, 2, 3], [4, 5, 6]] :> <<1 2 3> <4 5 6>> let B := $[[7, 8, 9], [10, 11, 12]] :> <<7 8 9> <10 11 12>> array::hcat(A, B) :> <<1 2 3 7 8 9> <4 5 6 10 11 12>>
fun array::vcat(Array₁: array, ...): arrayReturns a new array with the values of
Array₁, ..., Arrayₙconcatenated along the first dimension.let A := $[[1, 2, 3], [4, 5, 6]] :> <<1 2 3> <4 5 6>> let B := $[[7, 8, 9], [10, 11, 12]] :> <<7 8 9> <10 11 12>> array::vcat(A, B) :> <<1 2 3> <4 5 6> <7 8 9> <10 11 12>>
meth (A: array) != (B: array): integerCompare the degrees, dimensions and entries of
AandBand returnsnilif they match andBotherwise.meth (A: array) !== (B: any): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ != B then 1 else 0 end.meth (A: array) !== (B: complex): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ != B then 1 else 0 end.meth (A: array) !== (B: integer): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ != B then 1 else 0 end.meth (A: array) !== (B: real): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ != B then 1 else 0 end.meth (A: array) % (B: any): arrayReturns an array
Cwhere eachCᵥ := Aᵥ % B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A % 2 :> <<1 0> <1 0>>
meth (A: array) % (B: array): arrayReturns
A % B(element-wise). The shapes ofAandBmust be compatible, i.e. eitherA:shape = B:shapeorA:shapeis a prefix ofB:shapeorB:shapeis a prefix ofA:shape.
When the shapes are not the same, remaining dimensions are repeated (broadcast) to the required size.
let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> let B := array([[7, 8, 9], [10, 11, 12]]) :> <<7 8 9> <10 11 12>> let C := array([5, 10, 15]) :> <5 10 15> A % B :> <<1 2 3> <4 5 6>> B % A :> <<0 0 0> <2 1 0>> A % C :> <<1 2 3> <4 5 6>> C % A :> <<0 0 0> <1 0 3>> B % C :> <<2 8 9> <0 1 12>> C % B :> <<5 2 6> <5 10 3>>
meth (A: array) * (B: any): arrayReturns an array
Cwhere eachCᵥ := Aᵥ * B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A * 2 :> <<2 4> <6 8>>
meth (A: array) * (B: array): arrayReturns
A * B(element-wise). The shapes ofAandBmust be compatible, i.e. eitherA:shape = B:shapeorA:shapeis a prefix ofB:shapeorB:shapeis a prefix ofA:shape.
When the shapes are not the same, remaining dimensions are repeated (broadcast) to the required size.
let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> let B := array([[7, 8, 9], [10, 11, 12]]) :> <<7 8 9> <10 11 12>> let C := array([5, 10, 15]) :> <5 10 15> A * B :> <<7 16 27> <40 55 72>> B * A :> <<7 16 27> <40 55 72>> A * C :> <<5 20 45> <20 50 90>> C * A :> <<5 20 45> <20 50 90>> B * C :> <<35 80 135> <50 110 180>> C * B :> <<35 80 135> <50 110 180>>
meth (A: array) ** (B: array): arrayReturns an array with
Aᵢ * Bⱼfor each pair of elements ofAandB. The result will have shapeA:shape + B:shape.let A := array([1, 8, 3]) :> <1 8 3> let B := array([[7, 2], [4, 11]]) :> <<7 2> <4 11>> A:shape :> [3] B:shape :> [2, 2] let C := A ** B :> <<<7 2> <4 11>> <<56 16> <32 88>> <<21 6> <12 33>>> C:shape :> [3, 2, 2]
meth (A: array) + (B: any): arrayReturns an array
Cwhere eachCᵥ := Aᵥ + B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A + 2 :> <<3 4> <5 6>>
meth (A: array) + (B: array): arrayReturns
A + B(element-wise). The shapes ofAandBmust be compatible, i.e. eitherA:shape = B:shapeorA:shapeis a prefix ofB:shapeorB:shapeis a prefix ofA:shape.
When the shapes are not the same, remaining dimensions are repeated (broadcast) to the required size.
let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> let B := array([[7, 8, 9], [10, 11, 12]]) :> <<7 8 9> <10 11 12>> let C := array([5, 10, 15]) :> <5 10 15> A + B :> <<8 10 12> <14 16 18>> B + A :> <<8 10 12> <14 16 18>> A + C :> <<6 12 18> <9 15 21>> C + A :> <<6 12 18> <9 15 21>> B + C :> <<12 18 24> <15 21 27>> C + B :> <<12 18 24> <15 21 27>>
meth (A: array) ++ (B: array): arrayReturns an array with
Aᵢ + Bⱼfor each pair of elements ofAandB. The result will have shapeA:shape + B:shape.let A := array([1, 8, 3]) :> <1 8 3> let B := array([[7, 2], [4, 11]]) :> <<7 2> <4 11>> A:shape :> [3] B:shape :> [2, 2] let C := A ++ B :> <<<8 3> <5 12>> <<15 10> <12 19>> <<10 5> <7 14>>> C:shape :> [3, 2, 2]
meth -(Array: array): arrayReturns an array with the negated values from
Array.meth (A: array) - (B: any): arrayReturns an array
Cwhere eachCᵥ := Aᵥ - B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A - 2 :> <<-1 0> <1 2>>
meth (A: array) - (B: array): arrayReturns
A - B(element-wise). The shapes ofAandBmust be compatible, i.e. eitherA:shape = B:shapeorA:shapeis a prefix ofB:shapeorB:shapeis a prefix ofA:shape.
When the shapes are not the same, remaining dimensions are repeated (broadcast) to the required size.
let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> let B := array([[7, 8, 9], [10, 11, 12]]) :> <<7 8 9> <10 11 12>> let C := array([5, 10, 15]) :> <5 10 15> A - B :> <<-6 -6 -6> <-6 -6 -6>> B - A :> <<6 6 6> <6 6 6>> A - C :> <<-4 -8 -12> <-1 -5 -9>> C - A :> <<4 8 12> <1 5 9>> B - C :> <<2 -2 -6> <5 1 -3>> C - B :> <<-2 2 6> <-5 -1 3>>
meth (A: array) -- (B: array): arrayReturns an array with
Aᵢ - Bⱼfor each pair of elements ofAandB. The result will have shapeA:shape + B:shape.let A := array([1, 8, 3]) :> <1 8 3> let B := array([[7, 2], [4, 11]]) :> <<7 2> <4 11>> A:shape :> [3] B:shape :> [2, 2] let C := A -- B :> <<<-6 -1> <-3 -10>> <<1 6> <4 -3>> <<-4 1> <-1 -8>>> C:shape :> [3, 2, 2]
meth (A: array) . (B: array): arrayReturns the inner product of
AandB. The last dimension ofAand the first dimension ofBmust match, skipping any dimensions of size1.meth (A: array) / (B: any): arrayReturns an array
Cwhere eachCᵥ := Aᵥ / B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A / 2 :> <<0.5 1> <1.5 2>>
meth (A: array) / (B: array): arrayReturns
A / B(element-wise). The shapes ofAandBmust be compatible, i.e. eitherA:shape = B:shapeorA:shapeis a prefix ofB:shapeorB:shapeis a prefix ofA:shape.
When the shapes are not the same, remaining dimensions are repeated (broadcast) to the required size.
let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> let B := array([[7, 8, 9], [10, 11, 12]]) :> <<7 8 9> <10 11 12>> let C := array([5, 10, 15]) :> <5 10 15> A / B :> <<0.142857 0.25 0.333333> <0.4 0.454545 0.5>> B / A :> <<7 4 3> <2.5 2.2 2>> A / C :> <<0.2 0.2 0.2> <0.8 0.5 0.4>> C / A :> <<5 5 5> <1.25 2 2.5>> B / C :> <<1.4 0.8 0.6> <2 1.1 0.8>> C / B :> <<0.714286 1.25 1.66667> <0.5 0.909091 1.25>>
meth (A: array) // (B: array): arrayReturns an array with
Aᵢ / Bⱼfor each pair of elements ofAandB. The result will have shapeA:shape + B:shape.let A := array([1, 8, 3]) :> <1 8 3> let B := array([[7, 2], [4, 11]]) :> <<7 2> <4 11>> A:shape :> [3] B:shape :> [2, 2] let C := A // B :> <<<0.142857 0.5> <0.25 0.0909091>> <<1.14286 4> <2 0.727273>> <<0.428571 1.5> <0.75 0.272727>>> C:shape :> [3, 2, 2]
meth (A: array) /\ (B: array): arrayReturns
A /B(element-wise). The shapes ofAandBmust be compatible, i.e. eitherA:shape = B:shapeorA:shapeis a prefix ofB:shapeorB:shapeis a prefix ofA:shape.
When the shapes are not the same, remaining dimensions are repeated (broadcast) to the required size.
let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> let B := array([[7, 8, 9], [10, 11, 12]]) :> <<7 8 9> <10 11 12>> let C := array([5, 10, 15]) :> <5 10 15> A /\ B :> <<1 0 1> <0 1 4>> B /\ A :> <<1 0 1> <0 1 4>> A /\ C :> <<1 2 3> <4 0 6>> C /\ A :> <<1 2 3> <4 0 6>> B /\ C :> <<5 8 9> <0 10 12>> C /\ B :> <<5 8 9> <0 10 12>>
meth (A: array) /\ (B: integer): arrayReturns an array
Cwhere eachCᵥ := Aᵥ bitwise and B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A /\ 2 :> <<0 2> <2 0>>
meth (A: array) < (B: any): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ < B then 1 else 0 end.meth (A: array) < (B: complex): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ < B then 1 else 0 end.meth (A: array) < (B: integer): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ < B then 1 else 0 end.meth (A: array) < (B: real): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ < B then 1 else 0 end.meth (A: array) <= (B: any): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ <= B then 1 else 0 end.meth (A: array) <= (B: complex): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ <= B then 1 else 0 end.meth (A: array) <= (B: integer): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ <= B then 1 else 0 end.meth (A: array) <= (B: real): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ <= B then 1 else 0 end.meth (A: array) <> (B: array): integerCompare the degrees, dimensions and entries of
AandBand returns-1,0or1. This method is only intending for sorting arrays or using them as keys in a map.meth (A: array) = (B: array): integerCompare the degrees, dimensions and entries of
AandBand returnsBif they match andnilotherwise.meth (A: array) == (B: any): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ = B then 1 else 0 end.meth (A: array) == (B: complex): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ = B then 1 else 0 end.meth (A: array) == (B: integer): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ = B then 1 else 0 end.meth (A: array) == (B: real): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ = B then 1 else 0 end.meth (A: array) > (B: any): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ > B then 1 else 0 end.meth (A: array) > (B: complex): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ > B then 1 else 0 end.meth (A: array) > (B: integer): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ > B then 1 else 0 end.meth (A: array) > (B: real): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ > B then 1 else 0 end.meth (A: array) >< (B: array): arrayReturns
A >< B(element-wise). The shapes ofAandBmust be compatible, i.e. eitherA:shape = B:shapeorA:shapeis a prefix ofB:shapeorB:shapeis a prefix ofA:shape.
When the shapes are not the same, remaining dimensions are repeated (broadcast) to the required size.
let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> let B := array([[7, 8, 9], [10, 11, 12]]) :> <<7 8 9> <10 11 12>> let C := array([5, 10, 15]) :> <5 10 15> A >< B :> <<7 10 11> <14 15 14>> B >< A :> <<7 10 11> <14 15 14>> A >< C :> <<5 10 15> <5 15 15>> C >< A :> <<5 10 15> <5 15 15>> B >< C :> <<7 10 15> <15 11 15>> C >< B :> <<7 10 15> <15 11 15>>
meth (A: array) >< (B: integer): arrayReturns an array
Cwhere eachCᵥ := Aᵥ bitwise xor B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A >< 2 :> <<3 0> <1 6>>
meth (A: array) >= (B: any): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ >= B then 1 else 0 end.meth (A: array) >= (B: complex): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ >= B then 1 else 0 end.meth (A: array) >= (B: integer): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ >= B then 1 else 0 end.meth (A: array) >= (B: real): arrayReturns an array
Cwhere eachCᵥ := if Aᵥ >= B then 1 else 0 end.meth (Array: array)[Index₁: any, ...]: arrayReturns a sub-array of
Arraysharing the underlying data, indexed byIndexᵢ. Dimensions are copied to the output array, applying the indices as follows:If
Indexᵢisnilor*then the next dimension is copied unchanged.If
Indexᵢis..then the remaining indices are applied to the last dimensions ofArrayand the dimensions in between are copied unchanged.If
Indexᵢis anintegerthen theIndexᵢ-th value of the next dimension is selected and the dimension is dropped from the output.If
Indexᵢis aninteger::intervalthen the corresponding slice of the next dimension is copied to the output.If
Indexᵢis atuple[integer, ...]then the next dimensions are indexed by the corresponding integer in turn (i.e.A[(I, J, K)]gives the same result asA[I, J, K]).If
Indexᵢis alist[integer]then the next dimension is copied as a sparse dimension with the respective entries.If
Indexᵢis alist[tuple[integer, ...]]then the appropriate dimensions are dropped and a single sparse dimension is added with the corresponding entries.If
Indexᵢis anarray::int8with dimensions matching the corresponding dimensions ofAthen a sparse dimension is added with entries corresponding to the non-zero values inIndexᵢ(i.e.A[B]is equivalent toA[B:where]).If
Indexᵢis anarray::int32with all but last dimensions matching the corresponding dimensions ofAthen a sparse dimension is added with entries corresponding indices in the last dimension ofIndexᵢ.
If fewer than
A:degreeindices are provided then the remaining dimensions are copied unchanged.let A := array([[[19, 16, 12], [4, 7, 20]], [[5, 17, 8], [20, 9, 20]]]) A[1] :> <<19 16 12> <4 7 20>> A[1, 2] :> <4 7 20> A[1, 2, 3] :> 20 A[nil, 2] :> <<4 7 20> <20 9 20>> A[.., 3] :> <<12 20> <8 20>> A[.., 1 .. 2] :> <<<19 16> <4 7>> <<5 17> <20 9>>> A[(1, 2, 3)] :> 20 A[[(1, 2, 3), (2, 1, 1)]] :> <20 5> let B := A > 10 :> <<<1 1 1> <0 0 1>> <<0 1 0> <1 0 1>>> type(B) :> <<array::mutable::int8>> A[B] :> <19 16 12 20 17 20 20> let C := A:maxidx(2) :> <<2 3> <2 1>> type(C) :> <<matrix::mutable::int32>> A[C] :> <20 20>
meth (Array: array)[Indices: map]: arrayReturns a sub-array of
Arraysharing the underlying data. Thei-th dimension is indexed byIndices[i]if present, andnilotherwise.meth (A: array) \/ (B: array): arrayReturns
A / B(element-wise). The shapes ofAandBmust be compatible, i.e. eitherA:shape = B:shapeorA:shapeis a prefix ofB:shapeorB:shapeis a prefix ofA:shape.
When the shapes are not the same, remaining dimensions are repeated (broadcast) to the required size.
let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> let B := array([[7, 8, 9], [10, 11, 12]]) :> <<7 8 9> <10 11 12>> let C := array([5, 10, 15]) :> <5 10 15> A \/ B :> <<7 10 11> <14 15 14>> B \/ A :> <<7 10 11> <14 15 14>> A \/ C :> <<5 10 15> <5 15 15>> C \/ A :> <<5 10 15> <5 15 15>> B \/ C :> <<7 10 15> <15 11 15>> C \/ B :> <<7 10 15> <15 11 15>>
meth (A: array) \/ (B: integer): arrayReturns an array
Cwhere eachCᵥ := Aᵥ bitwise or B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A \/ 2 :> <<3 2> <3 6>>
meth ^(Array: array): arrayReturns the transpose of
Array, sharing the underlying data.let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> ^A :> <<1 4> <2 5> <3 6>>
meth (Array: array):copy: arrayReturn a new array with the same values of
Arraybut not sharing the underlying data.meth (Array: array):copy(Function: function): arrayReturn a new array with the results of applying
Functionto each value ofArray.meth (Array: array):count: integerReturn the number of elements in
Array.let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> A:count :> 6
meth (Array: array):degree: integerReturn the degree of
Array.let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> A:degree :> 2
meth (Arg₁: array):diagTBD
meth (Array: array):expand(Indices: list): arrayReturns an array sharing the underlying data with
Arraywith additional unit-length axes at the specifiedIndices.meth (Array: array):join(Start: integer, Count: integer): arrayReturns an array sharing the underlying data with
Arrayreplacing the dimensions atStart .. (Start + Count)with a single dimension with the same overall size.meth (A: array):max(B: array): arrayReturns
A max B(element-wise). The shapes ofAandBmust be compatible, i.e. eitherA:shape = B:shapeorA:shapeis a prefix ofB:shapeorB:shapeis a prefix ofA:shape.
When the shapes are not the same, remaining dimensions are repeated (broadcast) to the required size.
let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> let B := array([[7, 8, 9], [10, 11, 12]]) :> <<7 8 9> <10 11 12>> let C := array([5, 10, 15]) :> <5 10 15> A max B :> <<7 8 9> <10 11 12>> B max A :> <<7 8 9> <10 11 12>> A max C :> <<5 10 15> <5 10 15>> C max A :> <<5 10 15> <5 10 15>> B max C :> <<7 10 15> <10 11 15>> C max B :> <<7 10 15> <10 11 15>>
meth (A: array):max(B: integer): arrayReturns an array
Cwhere eachCᵥ := max(Aᵥ, B).let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A max 2 :> <<2 2> <3 4>>
meth (A: array):max(B: real): arrayReturns an array
Cwhere eachCᵥ := max(Aᵥ, B).let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A max 2.5 :> <<2.5 2.5> <3 4>>
meth (Array: array):maxidx: arrayReturns a new array with the indices of maximums of
Arrayin the lastCountdimensions.let A := array([[[19, 16, 12], [4, 7, 20]], [[5, 17, 8], [20, 9, 20]]]) A:maxidx :> <1 2 3>
meth (Array: array):maxidx(Count: integer): arrayReturns a new array with the indices of maximums of
Arrayin the lastCountdimensions.let A := array([[[19, 16, 12], [4, 7, 20]], [[5, 17, 8], [20, 9, 20]]]) A:maxidx(1) :> <<<1> <3>> <<2> <1>>> A:maxidx(2) :> <<2 3> <2 1>>
meth (Array: array):maxval: numberReturns the maximum of the values in
Array.let A := array([[[19, 16, 12], [4, 7, 20]], [[5, 17, 8], [20, 9, 20]]]) A:maxval :> 20
meth (Array: array):maxval(Count: integer): arrayReturns a new array with the maximums of
Arrayin the lastCountdimensions.let A := array([[[19, 16, 12], [4, 7, 20]], [[5, 17, 8], [20, 9, 20]]]) A:maxval(1) :> <<19 20> <17 20>> A:maxval(2) :> <20 20>
meth (A: array):min(B: array): arrayReturns
A min B(element-wise). The shapes ofAandBmust be compatible, i.e. eitherA:shape = B:shapeorA:shapeis a prefix ofB:shapeorB:shapeis a prefix ofA:shape.
When the shapes are not the same, remaining dimensions are repeated (broadcast) to the required size.
let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> let B := array([[7, 8, 9], [10, 11, 12]]) :> <<7 8 9> <10 11 12>> let C := array([5, 10, 15]) :> <5 10 15> A min B :> <<1 2 3> <4 5 6>> B min A :> <<1 2 3> <4 5 6>> A min C :> <<1 2 3> <4 5 6>> C min A :> <<1 2 3> <4 5 6>> B min C :> <<5 8 9> <5 10 12>> C min B :> <<5 8 9> <5 10 12>>
meth (A: array):min(B: integer): arrayReturns an array
Cwhere eachCᵥ := min(Aᵥ, B).let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A min 2 :> <<1 2> <2 2>>
meth (A: array):min(B: real): arrayReturns an array
Cwhere eachCᵥ := min(Aᵥ, B).let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A min 2.5 :> <<1 2> <2.5 2.5>>
meth (Array: array):minidx: arrayReturns a new array with the indices of minimums of
Arrayin the lastCountdimensions.let A := array([[[19, 16, 12], [4, 7, 20]], [[5, 17, 8], [20, 9, 20]]]) A:minidx :> <1 2 1>
meth (Array: array):minidx(Count: integer): arrayReturns a new array with the indices of minimums of
Arrayin the lastCountdimensions.let A := array([[[19, 16, 12], [4, 7, 20]], [[5, 17, 8], [20, 9, 20]]]) A:minidx(1) :> <<<3> <1>> <<1> <2>>> A:minidx(2) :> <<2 1> <1 1277720421>>
meth (Array: array):minval: numberReturns the minimum of the values in
Array.let A := array([[[19, 16, 12], [4, 7, 20]], [[5, 17, 8], [20, 9, 20]]]) A:minval :> 4
meth (Array: array):minval(Count: integer): arrayReturns a new array with the minimums
Arrayin the lastCountdimensions.let A := array([[[19, 16, 12], [4, 7, 20]], [[5, 17, 8], [20, 9, 20]]]) A:minval(1) :> <<12 4> <5 9>> A:minval(2) :> <4 5>
meth (Array: array):permute(Indices: integer, ...): arrayReturns an array sharing the underlying data with
Array, permuting the axes according toIndices.let A := array([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]) :> <<<1 2 3> <4 5 6>> <<7 8 9> <10 11 12>>> A:shape :> [2, 2, 3] let B := A:permute(2, 3, 1) :> <<<1 7> <2 8> <3 9>> <<4 10> <5 11> <6 12>>> B:shape :> [2, 3, 2]
meth (Array: array):permute(Indices: list): arrayReturns an array sharing the underlying data with
Array, permuting the axes according toIndices.let A := array([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]) :> <<<1 2 3> <4 5 6>> <<7 8 9> <10 11 12>>> A:shape :> [2, 2, 3] let B := A:permute([2, 3, 1]) :> <<<1 7> <2 8> <3 9>> <<4 10> <5 11> <6 12>>> B:shape :> [2, 3, 2]
meth (Array: array):prod: numberReturns the product of the values in
Array.let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> A:prod :> 720
meth (Array: array):prod(Count: integer): arrayReturns a new array with the products of
Arrayin the lastCountdimensions.let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> A:prod(1) :> <6 120>
meth (Array: array):prods(Index: integer): arrayReturns a new array with the partial products of
Arrayin theIndex-th dimension.meth (Array: array):reshape(Sizes: list): arrayReturns a copy of
Arraywith dimensions specified bySizes. .. note:This method always makes a copy of the data so that changes to the returned array do not affect the original.
meth (Array: array):reverse(Index: integer): arrayReturns an array sharing the underlying data with
Arraywith dimensionIndexreversed.meth (Array: array):shape: listReturn the shape of
Array.let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> A:shape :> [2, 3]
meth (Array: array):split(Index: integer, Sizes: list): arrayReturns an array sharing the underlying data with
Arrayreplacing the dimension atIndexwith new dimensions with sizesSizes. The total countSizes₁ * Sizes₂ * ... * Sizesₙmust equal the original size.meth (Array: array):strides: listReturn the strides of
Arrayin bytes.meth (Array: array):sum: numberReturns the sum of the values in
Array.let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> A:sum :> 21
meth (Array: array):sum(Index: integer): arrayReturns a new array with the sums of
Arrayin the lastCountdimensions.let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> A:sum(1) :> <6 15>
meth (Array: array):sums(Index: integer): arrayReturns a new array with the partial sums of
Arrayin theIndex-th dimension.meth (Array: array):swap: arrayReturns the transpose of
Array, sharing the underlying data.let A := array([[1, 2, 3], [4, 5, 6]]) :> <<1 2 3> <4 5 6>> A:swap :> <<1 4> <2 5> <3 6>>
meth (Array: array):swap(Index₁: integer, Index₂: integer): arrayReturns an array sharing the underlying data with
Arraywith dimensionsIndex₁andIndex₂swapped.meth (Array: array):where: listReturns a list of non-zero indices of
Array.meth (Array: array):where(Function: function): list[tuple]Returns list of indices
ArraywhereFunction(Arrayᵢ)returns a non-nil value.meth ||(Array: array): numberReturns the norm of the values in
Array.meth (Array: array) || (Arg₂: real): numberReturns the norm of the values in
Array.meth (Array: array) || (Arg₂: real, Arg₃: integer): numberReturns the norm of the values in
Array.type array::any < arrayTBD
type array::complex < arrayTBD
meth (A: array::complex) * (B: complex): arrayReturns an array
Cwhere eachCᵥ := Aᵥ * B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A * (1 + 1i) :> <<1 + 1i 2 + 2i> <3 + 3i 4 + 4i>>
meth (A: array::complex) + (B: complex): arrayReturns an array
Cwhere eachCᵥ := Aᵥ + B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A + (1 + 1i) :> <<2 + 1i 3 + 1i> <4 + 1i 5 + 1i>>
meth (A: array::complex) - (B: complex): arrayReturns an array
Cwhere eachCᵥ := Aᵥ - B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A - (1 + 1i) :> <<0 - 1i 1 - 1i> <2 - 1i 3 - 1i>>
meth (A: array::complex) / (B: complex): arrayReturns an array
Cwhere eachCᵥ := Aᵥ / B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A / (1 + 1i) :> <<0.5 - 0.5i 1 - 1i> <1.5 - 1.5i 2 - 2i>>
meth (Arg₁: array::complex) ^ (Arg₂: complex)TBD
type array::complex32 < array::complexTBD
type array::complex64 < array::complexTBD
type array::float32 < array::realTBD
type array::float64 < array::realTBD
type array::int16 < array::integerTBD
type array::int32 < array::integerTBD
type array::int64 < array::integerTBD
type array::int8 < array::integerTBD
type array::integer < array::realTBD
meth (A: array::integer) % (B: integer): arrayReturns an array
Cwhere eachCᵥ := Aᵥ % B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A % 2 :> <<1 0> <1 0>>
meth (A: array::integer) * (B: integer): arrayReturns an array
Cwhere eachCᵥ := Aᵥ * B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A * 2 :> <<2 4> <6 8>>
meth (A: array::integer) + (B: integer): arrayReturns an array
Cwhere eachCᵥ := Aᵥ + B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A + 2 :> <<3 4> <5 6>>
meth (A: array::integer) - (B: integer): arrayReturns an array
Cwhere eachCᵥ := Aᵥ - B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A - 2 :> <<-1 0> <1 2>>
meth (A: array::integer) / (B: integer): arrayReturns an array
Cwhere eachCᵥ := Aᵥ / B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A / 2 :> <<0.5 1> <1.5 2>>
type array::iteratorTBD
type array::mutable < array, bufferTBD
meth (Array: array::mutable):update(Function: function): arrayUpdate the values in
Arrayin place by applyingFunctionto each value.type array::mutable::any < array::any, array::mutableAn array of any values.
(A: array::mutable::any) := (B: number)Sets the values in
AtoB.(A: array::mutable::any) := (B: array | list)Sets the values in
Ato those inB, broadcasting as necessary. The shape ofBmust match the last dimensions ofA.
type array::mutable::complex < array::complex, array::mutableBase type for arrays of complex numbers.
type array::mutable::complex32 < array::complex32, array::mutable::complexAn array of complex32 values.
(A: array::mutable::complex32) := (B: number)Sets the values in
AtoB.(A: array::mutable::complex32) := (B: array | list)Sets the values in
Ato those inB, broadcasting as necessary. The shape ofBmust match the last dimensions ofA.
type array::mutable::complex64 < array::complex64, array::mutable::complexAn array of complex64 values.
(A: array::mutable::complex64) := (B: number)Sets the values in
AtoB.(A: array::mutable::complex64) := (B: array | list)Sets the values in
Ato those inB, broadcasting as necessary. The shape ofBmust match the last dimensions ofA.
type array::mutable::float32 < array::float32, array::mutable::realAn array of float32 values.
(A: array::mutable::float32) := (B: number)Sets the values in
AtoB.(A: array::mutable::float32) := (B: array | list)Sets the values in
Ato those inB, broadcasting as necessary. The shape ofBmust match the last dimensions ofA.
type array::mutable::float64 < array::float64, array::mutable::realAn array of float64 values.
(A: array::mutable::float64) := (B: number)Sets the values in
AtoB.(A: array::mutable::float64) := (B: array | list)Sets the values in
Ato those inB, broadcasting as necessary. The shape ofBmust match the last dimensions ofA.
type array::mutable::int16 < array::int16, array::mutable::integerAn array of int16 values.
(A: array::mutable::int16) := (B: number)Sets the values in
AtoB.(A: array::mutable::int16) := (B: array | list)Sets the values in
Ato those inB, broadcasting as necessary. The shape ofBmust match the last dimensions ofA.
type array::mutable::int32 < array::int32, array::mutable::integerAn array of int32 values.
(A: array::mutable::int32) := (B: number)Sets the values in
AtoB.(A: array::mutable::int32) := (B: array | list)Sets the values in
Ato those inB, broadcasting as necessary. The shape ofBmust match the last dimensions ofA.
type array::mutable::int64 < array::int64, array::mutable::integerAn array of int64 values.
(A: array::mutable::int64) := (B: number)Sets the values in
AtoB.(A: array::mutable::int64) := (B: array | list)Sets the values in
Ato those inB, broadcasting as necessary. The shape ofBmust match the last dimensions ofA.
type array::mutable::int8 < array::int8, array::mutable::integerAn array of int8 values.
(A: array::mutable::int8) := (B: number)Sets the values in
AtoB.(A: array::mutable::int8) := (B: array | list)Sets the values in
Ato those inB, broadcasting as necessary. The shape ofBmust match the last dimensions ofA.
type array::mutable::integer < array::integer, array::mutable::realBase type for arrays of integers.
type array::mutable::iterator < array::iteratorTBD
type array::mutable::real < array::real, array::mutable::complexBase type for arrays of real numbers.
type array::mutable::uint16 < array::uint16, array::mutable::integerAn array of uint16 values.
(A: array::mutable::uint16) := (B: number)Sets the values in
AtoB.(A: array::mutable::uint16) := (B: array | list)Sets the values in
Ato those inB, broadcasting as necessary. The shape ofBmust match the last dimensions ofA.
type array::mutable::uint32 < array::uint32, array::mutable::integerAn array of uint32 values.
(A: array::mutable::uint32) := (B: number)Sets the values in
AtoB.(A: array::mutable::uint32) := (B: array | list)Sets the values in
Ato those inB, broadcasting as necessary. The shape ofBmust match the last dimensions ofA.
type array::mutable::uint64 < array::uint64, array::mutable::integerAn array of uint64 values.
(A: array::mutable::uint64) := (B: number)Sets the values in
AtoB.(A: array::mutable::uint64) := (B: array | list)Sets the values in
Ato those inB, broadcasting as necessary. The shape ofBmust match the last dimensions ofA.
type array::mutable::uint8 < array::uint8, array::mutable::integerAn array of uint8 values.
(A: array::mutable::uint8) := (B: number)Sets the values in
AtoB.(A: array::mutable::uint8) := (B: array | list)Sets the values in
Ato those inB, broadcasting as necessary. The shape ofBmust match the last dimensions ofA.
type array::real < array::complexTBD
meth (A: array::real) % (B: real): arrayReturns an array
Cwhere eachCᵥ := Aᵥ % B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A % 2.5 :> error("TypeError", "Invalid types for array operation")
meth (A: array::real) * (B: real): arrayReturns an array
Cwhere eachCᵥ := Aᵥ * B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A * 2.5 :> <<2.5 5> <7.5 10>>
meth (A: array::real) + (B: real): arrayReturns an array
Cwhere eachCᵥ := Aᵥ + B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A + 2.5 :> <<3.5 4.5> <5.5 6.5>>
meth (A: array::real) - (B: real): arrayReturns an array
Cwhere eachCᵥ := Aᵥ - B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A - 2.5 :> <<-1.5 -0.5> <0.5 1.5>>
meth (A: array::real) / (B: real): arrayReturns an array
Cwhere eachCᵥ := Aᵥ / B.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> A / 2.5 :> <<0.4 0.8> <1.2 1.6>>
meth (Arg₁: array::real) ^ (Arg₂: real)TBD
type array::uint16 < array::integerTBD
type array::uint32 < array::integerTBD
type array::uint64 < array::integerTBD
type array::uint8 < array::integerTBD
meth (A: complex) !== (B: array): arrayReturns an array
Cwhere eachCᵥ := if A != Bᵥ then 1 else 0 end.meth (A: complex) * (B: array::complex): arrayReturns an array
Cwhere eachCᵥ := A * Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> (1 + 1i) * A :> <<1 + 1i 2 + 2i> <3 + 3i 4 + 4i>>
meth (A: complex) + (B: array::complex): arrayReturns an array
Cwhere eachCᵥ := A + Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> (1 + 1i) + A :> <<2 + 1i 3 + 1i> <4 + 1i 5 + 1i>>
meth (A: complex) - (B: array::complex): arrayReturns an array
Cwhere eachCᵥ := A - Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> (1 + 1i) - A :> <<0 + 1i -1 + 1i> <-2 + 1i -3 + 1i>>
meth (A: complex) / (B: array::complex): arrayReturns an array
Cwhere eachCᵥ := A / Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> (1 + 1i) / A :> <<1 + 1i 0.5 + 0.5i> <0.333333 + 0.333333i 0.25 + 0.25i>>
meth (A: complex) < (B: array): arrayReturns an array
Cwhere eachCᵥ := if A < Bᵥ then 1 else 0 end.meth (A: complex) <= (B: array): arrayReturns an array
Cwhere eachCᵥ := if A <= Bᵥ then 1 else 0 end.meth (A: complex) == (B: array): arrayReturns an array
Cwhere eachCᵥ := if A = Bᵥ then 1 else 0 end.meth (A: complex) > (B: array): arrayReturns an array
Cwhere eachCᵥ := if A > Bᵥ then 1 else 0 end.meth (A: complex) >= (B: array): arrayReturns an array
Cwhere eachCᵥ := if A >= Bᵥ then 1 else 0 end.fun array::cat(Index: integer, Array₁: any, ...): arrayReturns a new array with the values of
Array₁, ..., Arrayₙconcatenated along theIndex-th dimension.let A := $[[1, 2, 3], [4, 5, 6]] :> <<1 2 3> <4 5 6>> let B := $[[7, 8, 9], [10, 11, 12]] :> <<7 8 9> <10 11 12>> array::cat(1, A, B) :> <<1 2 3> <4 5 6> <7 8 9> <10 11 12>> array::cat(2, A, B) :> <<1 2 3 7 8 9> <4 5 6 10 11 12>>
meth (A: integer) !== (B: array): arrayReturns an array
Cwhere eachCᵥ := if A != Bᵥ then 1 else 0 end.meth (A: integer) % (B: array::integer): arrayReturns an array
Cwhere eachCᵥ := A % Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2 % A :> <<0 0> <2 2>>
meth (A: integer) * (B: array::integer): arrayReturns an array
Cwhere eachCᵥ := A * Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2 * A :> <<2 4> <6 8>>
meth (A: integer) + (B: array::integer): arrayReturns an array
Cwhere eachCᵥ := A + Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2 + A :> <<3 4> <5 6>>
meth (A: integer) - (B: array::integer): arrayReturns an array
Cwhere eachCᵥ := A - Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2 - A :> <<1 0> <-1 -2>>
meth (A: integer) / (B: array::integer): arrayReturns an array
Cwhere eachCᵥ := A / Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2 / A :> <<2 1> <0.666667 0.5>>
meth (A: integer) /\ (B: array): arrayReturns an array
Cwhere eachCᵥ := A bitwise and Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2 /\ A :> <<0 2> <2 0>>
meth (A: integer) < (B: array): arrayReturns an array
Cwhere eachCᵥ := if A < Bᵥ then 1 else 0 end.meth (A: integer) <= (B: array): arrayReturns an array
Cwhere eachCᵥ := if A <= Bᵥ then 1 else 0 end.meth (A: integer) == (B: array): arrayReturns an array
Cwhere eachCᵥ := if A = Bᵥ then 1 else 0 end.meth (A: integer) > (B: array): arrayReturns an array
Cwhere eachCᵥ := if A > Bᵥ then 1 else 0 end.meth (A: integer) >< (B: array): arrayReturns an array
Cwhere eachCᵥ := A bitwise xor Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2 >< A :> <<3 0> <1 6>>
meth (A: integer) >= (B: array): arrayReturns an array
Cwhere eachCᵥ := if A >= Bᵥ then 1 else 0 end.meth (A: integer) \/ (B: array): arrayReturns an array
Cwhere eachCᵥ := A bitwise or Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2 \/ A :> <<3 2> <3 6>>
meth (A: integer):max(B: array): arrayReturns an array
Cwhere eachCᵥ := max(A, Bᵥ).let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2 max A :> <<2 2> <3 4>>
meth (A: integer):min(B: array): arrayReturns an array
Cwhere eachCᵥ := min(A, Bᵥ).let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2 min A :> <<1 2> <2 2>>
meth permutation(Arg₁: integer, ...)TBD
meth $(List: list): arrayReturns an array with the contents of
List.meth ^(List: list): arrayReturns an array with the contents of
List, transposed.meth permutation(Arg₁: list)TBD
type matrix < arrayArrays with exactly 2 dimensions.
meth (T: matrix) @ (X: vector): vectorReturns
Xtransformed byT.Tmust be aN×Nmatrix andXa vector of sizeN - 1.meth \(A: matrix): matrixReturns the inverse of
A.meth (A: matrix) \ (B: vector): vectorReturns the solution
XofA . X = B.meth (A: matrix):det: anyReturns the determinant of
A.meth (A: matrix):lu: tuple[matrix, matrix, matrix]Returns a tuple of matrices
(L, U, P)such thatLis lower triangular,Uis upper triangular,Pis a permutation matrix andP . A = L . U.let A := $[[0, 5, 22/3], [4, 2, 1], [2, 7, 9]] :> <<0 5 7.33333> <4 2 1> <2 7 9>> let (L, U, P) := A:lu :> (<<1 0 0> <0.5 1 0> <0 0.833333 1>>, <<4 2 1> <0 6 8.5> <0 0 0.25>>, <<0 1 0> <0 0 1> <1 0 0>>) \P . L . U :> <<0 5 7.33333> <4 2 1> <2 7 9>>
meth (A: matrix):tr: anyReturns the trace of
A.type matrix::any < matrix, array::anyTBD
type matrix::complex < array::complex, matrixTBD
type matrix::complex32 < matrix::complex, array::complex32TBD
type matrix::complex64 < matrix::complex, array::complex64TBD
type matrix::float32 < matrix::real, array::float32TBD
type matrix::float64 < matrix::real, array::float64TBD
type matrix::int16 < matrix::integer, array::int16TBD
type matrix::int32 < matrix::integer, array::int32TBD
type matrix::int64 < matrix::integer, array::int64TBD
type matrix::int8 < matrix::integer, array::int8TBD
type matrix::integer < matrix::realTBD
type matrix::mutable < matrix, array::mutableTBD
type matrix::mutable::any < matrix::any, matrix::mutable, array::mutable::anyA matrix of any values.
type matrix::mutable::complex < array::mutable::complex, matrix::mutableBase type for matrices of complex numbers.
type matrix::mutable::complex32 < matrix::complex32, matrix::mutable::complex, array::mutable::complex32A matrix of complex32 values.
type matrix::mutable::complex64 < matrix::complex64, matrix::mutable::complex, array::mutable::complex64A matrix of complex64 values.
type matrix::mutable::float32 < matrix::float32, matrix::mutable::real, array::mutable::float32A matrix of float32 values.
type matrix::mutable::float64 < matrix::float64, matrix::mutable::real, array::mutable::float64A matrix of float64 values.
type matrix::mutable::int16 < matrix::int16, matrix::mutable::integer, array::mutable::int16A matrix of int16 values.
type matrix::mutable::int32 < matrix::int32, matrix::mutable::integer, array::mutable::int32A matrix of int32 values.
type matrix::mutable::int64 < matrix::int64, matrix::mutable::integer, array::mutable::int64A matrix of int64 values.
type matrix::mutable::int8 < matrix::int8, matrix::mutable::integer, array::mutable::int8A matrix of int8 values.
type matrix::mutable::integer < matrix::integer, matrix::mutable::realBase type for matrices of integers.
type matrix::mutable::real < matrix::real, array::mutable::real, matrix::mutable::complexBase type for matrices of real numbers.
type matrix::mutable::uint16 < matrix::uint16, matrix::mutable::integer, array::mutable::uint16A matrix of uint16 values.
type matrix::mutable::uint32 < matrix::uint32, matrix::mutable::integer, array::mutable::uint32A matrix of uint32 values.
type matrix::mutable::uint64 < matrix::uint64, matrix::mutable::integer, array::mutable::uint64A matrix of uint64 values.
type matrix::mutable::uint8 < matrix::uint8, matrix::mutable::integer, array::mutable::uint8A matrix of uint8 values.
type matrix::real < array::real, matrix::complexTBD
type matrix::uint16 < matrix::integer, array::uint16TBD
type matrix::uint32 < matrix::integer, array::uint32TBD
type matrix::uint64 < matrix::integer, array::uint64TBD
type matrix::uint8 < matrix::integer, array::uint8TBD
type permutation < vector::uint32A permutation of numbers
1 .. N(each number occurs exactly once).meth (Arg₁: permutation) -> (Arg₂: permutation)TBD
meth \(Arg₁: permutation)TBD
meth (A: real) !== (B: array): arrayReturns an array
Cwhere eachCᵥ := if A != Bᵥ then 1 else 0 end.meth (A: real) % (B: array::real): arrayReturns an array
Cwhere eachCᵥ := A % Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2.5 % A :> error("TypeError", "Invalid types for array operation")
meth (A: real) * (B: array::real): arrayReturns an array
Cwhere eachCᵥ := A * Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2.5 * A :> <<2.5 5> <7.5 10>>
meth (A: real) + (B: array::real): arrayReturns an array
Cwhere eachCᵥ := A + Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2.5 + A :> <<3.5 4.5> <5.5 6.5>>
meth (A: real) - (B: array::real): arrayReturns an array
Cwhere eachCᵥ := A - Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2.5 - A :> <<1.5 0.5> <-0.5 -1.5>>
meth (A: real) / (B: array::real): arrayReturns an array
Cwhere eachCᵥ := A / Bᵥ.let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2.5 / A :> <<2.5 1.25> <0.833333 0.625>>
meth (A: real) < (B: array): arrayReturns an array
Cwhere eachCᵥ := if A < Bᵥ then 1 else 0 end.meth (A: real) <= (B: array): arrayReturns an array
Cwhere eachCᵥ := if A <= Bᵥ then 1 else 0 end.meth (A: real) == (B: array): arrayReturns an array
Cwhere eachCᵥ := if A = Bᵥ then 1 else 0 end.meth (A: real) > (B: array): arrayReturns an array
Cwhere eachCᵥ := if A > Bᵥ then 1 else 0 end.meth (A: real) >= (B: array): arrayReturns an array
Cwhere eachCᵥ := if A >= Bᵥ then 1 else 0 end.meth (A: real):max(B: array): arrayReturns an array
Cwhere eachCᵥ := max(A, Bᵥ).let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2.5 max A :> <<2 2> <3 4>>
meth (A: real):min(B: array): arrayReturns an array
Cwhere eachCᵥ := min(A, Bᵥ).let A := array([[1, 2], [3, 4]]) :> <<1 2> <3 4>> 2.5 min A :> <<1 2> <2 2>>
type ref::anyTBD
type ref::complex32TBD
type ref::complex64TBD
type ref::float32TBD
type ref::float64TBD
type ref::int16TBD
type ref::int32TBD
type ref::int64TBD
type ref::int8TBD
type ref::uint16TBD
type ref::uint32TBD
type ref::uint64TBD
type ref::uint8TBD
meth $(Slice: slice): arrayReturns an array with the contents of
List.meth ^(Slice: slice): arrayReturns an array with the contents of
Slice, transposed.fun array::new(Arg₁: type, Arg₂: any)TBD
fun array::wrap(Type: type, Buffer: address, Sizes: list, Strides: list): arrayReturns an array pointing to the contents of
Addresswith the corresponding sizes and strides.let B := buffer(16) :> <16:00000000000000000000000000000000> array::wrap(array::uint16, B, [2, 2, 2], [8, 4, 2]) :> <<<0 0> <0 0>> <<0 0> <0 0>>>
type vector < arrayArrays with exactly 1 dimension.
meth (Arg₁: vector):bfind(Arg₂: any)TBD
meth (Arg₁: vector):orderTBD
meth (Arg₁: vector):order(Arg₂: function)TBD
type vector::any < vector, array::anyTBD
type vector::complex < array::complex, vectorTBD
type vector::complex32 < vector::complex, array::complex32TBD
type vector::complex64 < vector::complex, array::complex64TBD
type vector::float32 < vector::real, array::float32TBD
type vector::float64 < vector::real, array::float64TBD
type vector::int16 < vector::integer, array::int16TBD
type vector::int32 < vector::integer, array::int32TBD
type vector::int64 < vector::integer, array::int64TBD
type vector::int8 < vector::integer, array::int8TBD
type vector::integer < vector::realTBD
type vector::mutable < vector, array::mutableTBD
type vector::mutable::any < vector::any, vector::mutable, array::mutable::anyA vector of any values.
type vector::mutable::complex < vector::complex, array::mutable::complex, vector::mutableBase type for vectors of complex numbers.
type vector::mutable::complex32 < vector::complex32, vector::mutable::complex, array::mutable::complex32A vector of complex32 values.
type vector::mutable::complex64 < vector::complex64, vector::mutable::complex, array::mutable::complex64A vector of complex64 values.
type vector::mutable::float32 < vector::float32, vector::mutable::real, array::mutable::float32A vector of float32 values.
type vector::mutable::float64 < vector::float64, vector::mutable::real, array::mutable::float64A vector of float64 values.
type vector::mutable::int16 < vector::int16, vector::mutable::integer, array::mutable::int16A vector of int16 values.
type vector::mutable::int32 < vector::int32, vector::mutable::integer, array::mutable::int32A vector of int32 values.
type vector::mutable::int64 < vector::int64, vector::mutable::integer, array::mutable::int64A vector of int64 values.
type vector::mutable::int8 < vector::int8, vector::mutable::integer, array::mutable::int8A vector of int8 values.
type vector::mutable::integer < vector::integer, vector::mutable::realBase type for vectors of integers.
type vector::mutable::real < vector::real, array::mutable::real, vector::mutable::complexBase type for vectors of real numbers.
type vector::mutable::uint16 < vector::uint16, vector::mutable::integer, array::mutable::uint16A vector of uint16 values.
type vector::mutable::uint32 < vector::uint32, vector::mutable::integer, array::mutable::uint32A vector of uint32 values.
type vector::mutable::uint64 < vector::uint64, vector::mutable::integer, array::mutable::uint64A vector of uint64 values.
type vector::mutable::uint8 < vector::uint8, vector::mutable::integer, array::mutable::uint8A vector of uint8 values.
type vector::real < array::real, vector::complexTBD
meth (Vector: vector::real):softmax: vectorReturns
softmax(Vector).let A := array([1, 4.2, 0.6, 1.23, 4.3, 1.2, 2.5]) :> <1 4.2 0.6 1.23 4.3 1.2 2.5> let B := A:softmax :> <0.01659 0.406995 0.0111206 0.0208802 0.449799 0.0202631 0.0743513>
type vector::uint16 < vector::integer, array::uint16TBD
type vector::uint32 < vector::integer, array::uint32TBD
type vector::uint64 < vector::integer, array::uint64TBD
type vector::uint8 < vector::integer, array::uint8TBD
meth (Arg₁: visitor):const(Arg₂: array)TBD
meth (Arg₁: visitor):copy(Arg₂: array)TBD