Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Aug 20, 2018
2 parents 60a90f8 + 59827f0 commit 91f7778
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ os:
- linux
- osx
julia:
- 0.7
- 1.0
- nightly
matrix:
allow_failures:
Expand Down
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
julia 0.7-beta2
julia 1.0
RecursiveArrayTools 0.8.0
DiffEqBase 0.11.0
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
environment:
matrix:
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.7-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.7-latest-win64.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/1.0/julia-1.0-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/1.0/julia-1.0-latest-win64.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
matrix:
Expand Down
22 changes: 19 additions & 3 deletions src/level_iterations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,26 @@ struct LevelIterIdx{T}
end
LevelIterIdx(S::AbstractMultiScaleArray, n::Int) = LevelIterIdx(level_iter(S, n))

Base.start(l::LevelIterIdx) = (start(l.iter), 1)
function Base.next(l::LevelIterIdx, state)
start(l::LevelIterIdx) = (start(l.iter), 1)
function next(l::LevelIterIdx, state)
val, new_state = next(l.iter, state[1])
end_idx = state[2] + length(val) - 1
((val, state[2], end_idx), (new_state, end_idx + 1))
end
Base.done(l::LevelIterIdx, state) = done(l.iter, state[1])
done(l::LevelIterIdx, state) = done(l.iter, state[1])

function Base.iterate(l::LevelIterIdx)
x = iterate(l.iter)
x == nothing && return nothing
val, new_state = x
end_idx = 1 + length(val) - 1
((val, 1, end_idx), (new_state, end_idx + 1))
end

function Base.iterate(l::LevelIterIdx,state)
x = iterate(l.iter,state[1])
x == nothing && return nothing
val, new_state = x
end_idx = state[2] + length(val) - 1
((val, state[2], end_idx), (new_state, end_idx + 1))
end

0 comments on commit 91f7778

Please sign in to comment.