TensorCast.jl icon indicating copy to clipboard operation
TensorCast.jl copied to clipboard

Repeat example from the docs is broken

Open mcabbott opened this issue 4 years ago • 0 comments

julia> M = Array(reshape(1:12, 3,4))
3×4 Matrix{Int64}:
 1  4  7  10
 2  5  8  11
 3  6  9  12

julia> @cast R[r,(n,c)] := M[r,c]^2  (n in 1:3)
ERROR: LoadError: index n appears only on the left

julia> V = [10,20,30];

julia> @cast _[i,j] := V[i]   (j in 1:4)  # simpler version
ERROR: LoadError: index j appears only on the left

julia> @cast _[i,j] := V[i] + 0j   (j in 1:4)  # this works!
3×4 Matrix{Int64}:
 10  10  10  10
 20  20  20  20
 30  30  30  30

mcabbott avatar Aug 21 '21 03:08 mcabbott