Skip to content

Commit

Permalink
generic dense zero'd Jacobians
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Apr 18, 2019
1 parent 7308b33 commit 36203d1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/caches/firk_caches.jl
Expand Up @@ -82,7 +82,7 @@ function alg_cache(alg::RadauIIA5,u,rate_prototype,uEltypeNoUnits,uBottomEltypeN
k = similar(rate_prototype); k2 = similar(rate_prototype); k3 = similar(rate_prototype)
fw1 = similar(rate_prototype); fw2 = similar(rate_prototype); fw3 = similar(rate_prototype)

J = fill(zero(uEltypeNoUnits),length(u),length(u))
J = false .* rate_prototype .* rate_prototype'
W1 = similar(J); W2 = similar(J, Complex{eltype(J)})

du1 = similar(rate_prototype)
Expand Down
2 changes: 1 addition & 1 deletion src/caches/linear_caches.jl
Expand Up @@ -10,7 +10,7 @@ end

function alg_cache(alg::MidpointSplitting,u,rate_prototype,uEltypeNoUnits,
tTypeNoUnits,uprev,uprev2,f,t,dt,reltol,p,calck,::Type{Val{true}})
W = fill(zero(uEltypeNoUnits),length(u),length(u)) # uEltype?
W = false .* rate_prototype .* rate_prototype' # uEltype?
k = zero(rate_prototype); fsalfirst = zero(rate_prototype)
MidpointSplittingCache(u,uprev,uprev2,similar(u),fsalfirst,W,k)
end
Expand Down
28 changes: 14 additions & 14 deletions src/caches/rosenbrock_caches.jl
Expand Up @@ -66,7 +66,7 @@ function alg_cache(alg::Rosenbrock23,u,rate_prototype,uEltypeNoUnits,uBottomElty
W = WOperator(f, dt, true)
J = nothing # is J = W.J better?
else
J = zero(rate_prototype .* rate_prototype') # uEltype?
J = false .* rate_prototype .* rate_prototype' # uEltype?
W = similar(J)
end
tmp = zero(rate_prototype)
Expand Down Expand Up @@ -99,7 +99,7 @@ function alg_cache(alg::Rosenbrock32,u,rate_prototype,uEltypeNoUnits,uBottomElty
W = WOperator(f, dt, true)
J = nothing # is J = W.J better?
else
J = fill(zero(uEltypeNoUnits),length(u),length(u)) # uEltype?
J = false .* rate_prototype .* rate_prototype' # uEltype?
W = similar(J)
end
tmp = zero(rate_prototype)
Expand Down Expand Up @@ -202,7 +202,7 @@ function alg_cache(alg::ROS3P,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUni
W = WOperator(f, dt, true)
J = nothing # is J = W.J better?
else
J = fill(zero(uEltypeNoUnits),length(u),length(u)) # uEltype?
J = false .* rate_prototype .* rate_prototype' # uEltype?
W = similar(J)
end
tmp = zero(rate_prototype)
Expand Down Expand Up @@ -264,7 +264,7 @@ function alg_cache(alg::Rodas3,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUn
W = WOperator(f, dt, true)
J = nothing # is J = W.J better?
else
J = fill(zero(uEltypeNoUnits),length(u),length(u)) # uEltype?
J = false .* rate_prototype .* rate_prototype' # uEltype?
W = similar(J)
end
tmp = zero(rate_prototype)
Expand Down Expand Up @@ -344,7 +344,7 @@ function alg_cache(alg::RosShamp4,u,rate_prototype,uEltypeNoUnits,uBottomEltypeN
W = WOperator(f, dt, true)
J = nothing # is J = W.J better?
else
J = fill(zero(uEltypeNoUnits),length(u),length(u)) # uEltype?
J = false .* rate_prototype .* rate_prototype' # uEltype?
W = similar(J)
end
tmp = zero(rate_prototype)
Expand Down Expand Up @@ -382,7 +382,7 @@ function alg_cache(alg::Veldd4,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUn
W = WOperator(f, dt, true)
J = nothing # is J = W.J better?
else
J = fill(zero(uEltypeNoUnits),length(u),length(u)) # uEltype?
J = false .* rate_prototype .* rate_prototype' # uEltype?
W = similar(J)
end
tmp = zero(rate_prototype)
Expand Down Expand Up @@ -420,7 +420,7 @@ function alg_cache(alg::Velds4,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUn
W = WOperator(f, dt, true)
J = nothing # is J = W.J better?
else
J = fill(zero(uEltypeNoUnits),length(u),length(u)) # uEltype?
J = false .* rate_prototype .* rate_prototype' # uEltype?
W = similar(J)
end
tmp = zero(rate_prototype)
Expand Down Expand Up @@ -458,7 +458,7 @@ function alg_cache(alg::GRK4T,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUni
W = WOperator(f, dt, true)
J = nothing # is J = W.J better?
else
J = fill(zero(uEltypeNoUnits),length(u),length(u)) # uEltype?
J = false .* rate_prototype .* rate_prototype' # uEltype?
W = similar(J)
end
tmp = zero(rate_prototype)
Expand Down Expand Up @@ -496,7 +496,7 @@ function alg_cache(alg::GRK4A,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUni
W = WOperator(f, dt, true)
J = nothing # is J = W.J better?
else
J = fill(zero(uEltypeNoUnits),length(u),length(u)) # uEltype?
J = false .* rate_prototype .* rate_prototype' # uEltype?
W = similar(J)
end
tmp = zero(rate_prototype)
Expand Down Expand Up @@ -534,7 +534,7 @@ function alg_cache(alg::Ros4LStab,u,rate_prototype,uEltypeNoUnits,uBottomEltypeN
W = WOperator(f, dt, true)
J = nothing # is J = W.J better?
else
J = fill(zero(uEltypeNoUnits),length(u),length(u)) # uEltype?
J = false .* rate_prototype .* rate_prototype' # uEltype?
W = similar(J)
end
tmp = zero(rate_prototype)
Expand Down Expand Up @@ -615,7 +615,7 @@ function alg_cache(alg::Rodas4,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUn
W = WOperator(f, dt, true)
J = nothing # is J = W.J better?
else
J = fill(zero(uEltypeNoUnits),length(u),length(u)) # uEltype?
J = false .* rate_prototype .* rate_prototype' # uEltype?
W = similar(J)
end
tmp = zero(rate_prototype)
Expand Down Expand Up @@ -658,7 +658,7 @@ function alg_cache(alg::Rodas42,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoU
W = WOperator(f, dt, true)
J = nothing # is J = W.J better?
else
J = fill(zero(uEltypeNoUnits),length(u),length(u)) # uEltype?
J = false .* rate_prototype .* rate_prototype' # uEltype?
W = similar(J)
end
tmp = zero(rate_prototype)
Expand Down Expand Up @@ -701,7 +701,7 @@ function alg_cache(alg::Rodas4P,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoU
W = WOperator(f, dt, true)
J = nothing # is J = W.J better?
else
J = fill(zero(uEltypeNoUnits),length(u),length(u)) # uEltype?
J = false .* rate_prototype .* rate_prototype' # uEltype?
W = similar(J)
end
tmp = zero(rate_prototype)
Expand Down Expand Up @@ -787,7 +787,7 @@ function alg_cache(alg::Rodas5,u,rate_prototype,uEltypeNoUnits,uBottomEltypeNoUn
W = WOperator(f, dt, true)
J = nothing # is J = W.J better?
else
J = fill(zero(uEltypeNoUnits),length(u),length(u)) # uEltype?
J = false .* rate_prototype .* rate_prototype' # uEltype?
W = similar(J)
end
tmp = zero(rate_prototype)
Expand Down
2 changes: 1 addition & 1 deletion src/nlsolve/utils.jl
Expand Up @@ -117,7 +117,7 @@ DiffEqBase.@def iipnlsolve begin
W = WOperator(f, dt, true)
J = nothing # is J = W.J better?
else
J = zero(u .* u')
J = false .* u .* u'
W = similar(J)
end
end
Expand Down

0 comments on commit 36203d1

Please sign in to comment.