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

Seemingly extension of example in SciMLOperators doesn’t work

Open Veenty opened this issue 9 months ago • 0 comments

Just following the tutorial I would like to be able to define operator L6, as follows

N = 4
f = (u, p, t) -> u .* u

M = MatrixOperator(rand(N, N))
D = DiagonalOperator(rand(N))
F = FunctionOperator(f, zeros(N), zeros(N))

L1 = 2M + 3F + LinearAlgebra.I + rand(N, N)
L2 = D * F * M'
L3 = kron(M, D, F)
L4 = M \ D
L5 = [M; D]' * [M F; F D] * [F; D]
L6 = [F; D]  #generates a 2N x N operator

L6(rand(N), nothing, 0)

But the last line generates the error

ERROR: MethodError: objects of type Vector{SciMLOperators.AbstractSciMLOperator{Float64}} are not callable
Use square brackets [] for indexing an Array.
The object of type `Vector{SciMLOperators.AbstractSciMLOperator{Float64}}` exists, but no method is defined for this combination of argument types when trying to treat it as a callable object.

Seems that cat has not been overload?

Veenty avatar Mar 24 '25 15:03 Veenty