Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Commit c1d0cc3

Browse files
fix compats and undefined memory
1 parent 06ddd90 commit c1d0cc3

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ BandedMatrices = "0.15.11"
2222
BlockBandedMatrices = "0.8.6, 0.9"
2323
DiffEqBase = "6.4.1"
2424
ForwardDiff = "0.10"
25-
LazyArrays = "0.16.12"
26-
LazyBandedMatrices = "0.2.11"
25+
LazyArrays = "0.17"
26+
LazyBandedMatrices = "0.3"
2727
ModelingToolkit = "0.10.0, 1.0, 2.0, 3.0"
2828
NNlib = "0.6, 0.7"
2929
StaticArrays = "0.10, 0.11, 0.12"

src/derivative_operators/multi_dim_bc_operators.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ slice_rmul lets you multiply each vector like strip of an array `u` with a linea
1616
"""
1717
function slice_rmul(A::AbstractDiffEqLinearOperator, u::AbstractArray{T,N}, dim::Int) where {T,N}
1818
@assert N != 1
19-
u_temp = similar(u)
19+
u_temp = zero(u)
2020

2121
_slice_rmul!(u_temp, A, u, dim, CartesianIndices(axes(u)[1:dim-1]), CartesianIndices(axes(u)[(dim+1):end]))
2222

src/matrixfree_operators.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ end
2424
return n <= length(M.size) ? M.size[n] : 1
2525
end
2626
@inline ==(M1::MatrixFreeOperator, M2::MatrixFreeOperator) = M1.f == M2.f && M1.args == M2.args && M1.size == M2.size && M1.opnorm == M2.opnorm && M1.ishermitian == M2.ishermitian
27-
@inline Base.:*(A::MatrixFreeOperator, X::AbstractVecOrMat) = mul!(similar(X), A, X)
27+
@inline Base.:*(A::MatrixFreeOperator, X::AbstractVecOrMat) = mul!(zero(X), A, X)
2828

2929
# Overloading LinearAlgebra functions
3030
LinearAlgebra.ishermitian(M::MatrixFreeOperator) = M.ishermitian
@@ -60,7 +60,7 @@ end
6060

6161
function (M::MatrixFreeOperator{F,N})(u, p, t) where {F,N}
6262
update_coefficients!(M,u,p,t)
63-
du = similar(u)
63+
du = zero(u)
6464
if isconstant(M)
6565
M.f(du, u, p)
6666
else

0 commit comments

Comments
 (0)