getindex of range in IdentityMultiple
schillic opened this issue · comments
Christian Schilling commented
The type of ind
has to be restricted to Integer
and another method for StepRange
(or the supertype OrdinalRange
or even that one's supertype AbstractRange
) needs to be added.
MathematicalSystems.jl/src/identity.jl
Lines 87 to 98 in a456045
julia> I = IdentityMultiple(1.0, 2)
IdentityMultiple{Float64} of value 1.0 and order 2
julia> Diagonal(I)
ERROR: MethodError: no method matching isless(::Int64, ::StepRange{Int64,Int64})
Closest candidates are:
isless(::Missing, ::Any) at missing.jl:66
isless(::Real, ::AbstractFloat) at operators.jl:157
isless(::Real, ::Real) at operators.jl:346
...
Stacktrace:
[1] <(::Int64, ::StepRange{Int64,Int64}) at ./operators.jl:268
[2] <=(::Int64, ::StepRange{Int64,Int64}) at ./operators.jl:317
[3] getindex(::IdentityMultiple{Float64}, ::StepRange{Int64,Int64}) at .julia/dev/MathematicalSystems/src/identity.jl:93