Skip to content

Commit c31e3d7

Browse files
Merge pull request #60 from chriselrod/eachindexarrayoperator
Add eachindex for DiffEqArrayOperator
2 parents 4cd5cef + 6fa24ec commit c31e3d7

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/operators/basic_operators.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ Base.eachrow(L::DiffEqArrayOperator) = eachrow(L.A)
108108
Base.length(L::DiffEqArrayOperator) = length(L.A)
109109
Base.iterate(L::DiffEqArrayOperator,args...) = iterate(L.A,args...)
110110
Base.axes(L::DiffEqArrayOperator) = axes(L.A)
111+
Base.eachindex(L::DiffEqArrayOperator) = eachindex(L.A)
111112
Base.IndexStyle(::Type{<:DiffEqArrayOperator{T,AType}}) where {T,AType} = Base.IndexStyle(AType)
112113
Base.copyto!(L::DiffEqArrayOperator, rhs) = (copyto!(L.A, rhs); L)
113114
Base.copyto!(L::DiffEqArrayOperator, rhs::Base.Broadcast.Broadcasted{<:StaticArrays.StaticArrayStyle}) = (copyto!(L.A, rhs); L)

test/diffeqoperator.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using SciMLBase
2+
3+
@testset "DiffEqOperator" begin
4+
A = rand(10,10);
5+
@test eachindex(A) === eachindex(SciMLBase.DiffEqArrayOperator(A))
6+
@test eachindex(A') === eachindex(SciMLBase.DiffEqArrayOperator(A'))
7+
end
8+

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ if GROUP == "Core" || GROUP == "All"
2121
@time @safetestset "Existence functions" begin include("existence_functions.jl") end
2222
@time @safetestset "Integrator interface" begin include("integrator_tests.jl") end
2323
@time @safetestset "Ensemble functionality" begin include("ensemble_tests.jl") end
24+
@time @safetestset "DiffEqOperator tests" begin include("diffeqoperator.jl") end
2425
end
2526

2627
if !is_APPVEYOR && GROUP == "Downstream"

0 commit comments

Comments
 (0)