Skip to content

Commit 4373c30

Browse files
addat deleteat
1 parent 6125789 commit 4373c30

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/DiffEqBase.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ module DiffEqBase
124124

125125
export tuples, intervals
126126

127-
export resize!,deleteat!,full_cache,user_cache,u_cache,du_cache,terminate!,
127+
export resize!,deleteat!,addat!,full_cache,user_cache,u_cache,du_cache,
128+
resize_non_user_cache!,deleteat_non_user_cache!,addat_non_user_cache!,
129+
terminate!,
128130
add_tstop!,add_saveat!,set_abstol!,
129131
set_reltol!,get_du,get_dt,get_proposed_dt,modify_proposed_dt!,u_modified!,
130132
savevalues!

src/integrator_interface.jl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
resize!(i::DEIntegrator,ii::Int) = error("This method has not been implemented for the integrator")
2-
deleteat!(i::DEIntegrator,ii::Int) = error("This method has not been implemented for the integrator")
2+
deleteat!(i::DEIntegrator,ii) = error("This method has not been implemented for the integrator")
3+
addat!(i::DEIntegrator,ii,val=zeros(length(idxs))) = error("This method has not been implemented for the integrator")
34
user_cache(i::DEIntegrator) = error("This method has not been implemented for the integrator")
45
u_cache(i::DEIntegrator) = error("This method has not been implemented for the integrator")
56
du_cache(i::DEIntegrator) = error("This method has not been implemented for the integrator")
67
full_cache(i::DEIntegrator) = error("This method has not been implemented for the integrator")
8+
resize_non_user_cache!(i::DEIntegrator,ii::Int) = error("This method has not been implemented for the integrator")
9+
deleteat_non_user_cache!(i::DEIntegrator,idxs) = error("This method has not been implemented for the integrator")
10+
addat_non_user_cache!(i::DEIntegrator,idxs) = error("This method has not been implemented for the integrator")
711
terminate!(i::DEIntegrator) = error("This method has not been implemented for the integrator")
812
get_du(i::DEIntegrator) = error("This method has not been implemented for the integrator")
913
get_dt(i::DEIntegrator) = error("This method has not been implemented for the integrator")
@@ -16,6 +20,13 @@ add_saveat!(i::DEIntegrator,t) = error("This method has not been implemented for
1620
set_abstol!(i::DEIntegrator,t) = error("This method has not been implemented for the integrator")
1721
set_reltol!(i::DEIntegrator,t) = error("This method has not been implemented for the integrator")
1822

23+
### Addat isn't a real thing. Let's make it a real thing Gretchen
24+
25+
function addat!(a::AbstractArray,idxs,val=zeros(length(idxs)))
26+
flip_range = UnitRange(idxs.start,idxs.start-length(idxs))
27+
splice!(a,flip_range,val)
28+
end
29+
1930
### Abstract Interface
2031

2132
immutable IntegratorTuples{I}

0 commit comments

Comments
 (0)