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

Commit

Permalink
Merge pull request #66 from MSeeker1340/hotfix
Browse files Browse the repository at this point in the history
`size(A, n)` hotfix for array operator
  • Loading branch information
ChrisRackauckas committed Jul 9, 2018
2 parents 97cb183 + 1d01aad commit 1361084
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/array_operator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Base.full(L::DiffEqArrayOperator) = full(L.A) .* L.α.coeff
Base.exp(L::DiffEqArrayOperator) = exp(full(L))
DiffEqBase.has_exp(L::DiffEqArrayOperator) = true
Base.size(L::DiffEqArrayOperator) = size(L.A)
Base.size(L::DiffEqArrayOperator, m::Integer) = size(L.A, m)
LinearAlgebra.opnorm(L::DiffEqArrayOperator, p::Real=2) = opnorm(L.A, p) * abs(L.α.coeff)
DiffEqBase.update_coefficients!(L::DiffEqArrayOperator,u,p,t) = (L.update_func(L.A,u,p,t); L.α = L.α(t); nothing)
DiffEqBase.update_coefficients(L::DiffEqArrayOperator,u,p,t) = (L.update_func(L.A,u,p,t); L.α = L.α(t); L)
Expand Down Expand Up @@ -85,17 +86,17 @@ Base.:*(L::DiffEqArrayOperator,b::AbstractArray) = L.α.coeff*L.A*b

function LinearAlgebra.mul!(v::AbstractVector,L::DiffEqArrayOperator,b::AbstractVector)
mul!(v,L.A,b)
scale!(v,L.α.coeff)
rmul!(v,L.α.coeff)
end

function LinearAlgebra.mul!(v::AbstractArray,L::DiffEqArrayOperator,b::AbstractArray)
mul!(v,L.A,b)
scale!(v,L.α.coeff)
rmul!(v,L.α.coeff)
end

function Base.A_ldiv_B!(x,L::DiffEqArrayOperator, b::AbstractArray)
A_ldiv_B!(x,L.A,b)
scale!(x,inv(L.α.coeff))
rmul!(x,inv(L.α.coeff))
end

function Base.:/(x,L::DiffEqArrayOperator)
Expand Down Expand Up @@ -134,7 +135,7 @@ Base.svdfact!(L::DiffEqArrayOperator,args...) = FactorizedDiffEqArrayOperator(s

function Base.A_ldiv_B!(x,L::FactorizedDiffEqArrayOperator, b::AbstractArray)
A_ldiv_B!(x,L.A,b)
scale!(x,inv(L.inv_coeff))
rmul!(x,inv(L.inv_coeff))
end

function Base.:\(L::FactorizedDiffEqArrayOperator, b::AbstractArray)
Expand Down

0 comments on commit 1361084

Please sign in to comment.