Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SciMLBase"
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
authors = ["Chris Rackauckas <[email protected]> and contributors"]
version = "1.81.0"
version = "1.81.1"

[deps]
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
Expand Down
34 changes: 19 additions & 15 deletions src/operators/basic_operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ function Base.copy(L::DiffEqArrayOperator)
DiffEqArrayOperator(copy(L.A); update_func = L.update_func)
end

const AdjointFact = isdefined(LinearAlgebra, :AdjointFactorization) ? LinearAlgebra.AdjointFactorization : Adjoint
const TransposeFact = isdefined(LinearAlgebra, :TransposeFactorization) ? LinearAlgebra.TransposeFactorization : Transpose

"""
FactorizedDiffEqArrayOperator(F)

Expand All @@ -137,26 +140,27 @@ Supports left division and `ldiv!` when applied to an array.
struct FactorizedDiffEqArrayOperator{T <: Number,
FType <: Union{
Factorization{T}, Diagonal{T}, Bidiagonal{T},
Adjoint{T, <:Factorization{T}}
AdjointFact{T, <:Factorization{T}},
TransposeFact{T, <:Factorization{T}}
}
} <: AbstractDiffEqLinearOperator{T}
F::FType
end

function Base.convert(::Type{AbstractMatrix}, L::FactorizedDiffEqArrayOperator)
if L.F isa Adjoint
convert(AbstractMatrix, L.F')'
else
convert(AbstractMatrix, L.F)
end
end
function Base.Matrix(L::FactorizedDiffEqArrayOperator)
if L.F isa Adjoint
Matrix(L.F')'
else
Matrix(L.F)
end
end
Base.convert(::Type{AbstractMatrix}, L::FactorizedDiffEqArrayOperator{<:Any,<:Union{Factorization,AbstractMatrix}}) =
convert(AbstractMatrix, L.F)
Base.convert(::Type{AbstractMatrix}, L::FactorizedDiffEqArrayOperator{<:Any,<:Union{Adjoint,AdjointFact}}) =
adjoint(convert(AbstractMatrix, adjoint(L.F)))
Base.convert(::Type{AbstractMatrix}, L::FactorizedDiffEqArrayOperator{<:Any,<:Union{Transpose,TransposeFact}}) =
transpose(convert(AbstractMatrix, transpose(L.F)))

Base.Matrix(L::FactorizedDiffEqArrayOperator{<:Any,<:Union{Factorization,AbstractMatrix}}) =
Matrix(L.F)
Base.Matrix(L::FactorizedDiffEqArrayOperator{<:Any,<:Union{Adjoint,AdjointFact}}) =
adjoint(Matrix(adjoint(L.F)))
Base.Matrix(L::FactorizedDiffEqArrayOperator{<:Any,<:Union{Transpose,TransposeFact}}) =
transpose(Matrix(transpose(L.F)))

Base.adjoint(L::FactorizedDiffEqArrayOperator) = FactorizedDiffEqArrayOperator(L.F')
Base.size(L::FactorizedDiffEqArrayOperator, args...) = size(L.F, args...)
function LinearAlgebra.ldiv!(Y::AbstractVecOrMat, L::FactorizedDiffEqArrayOperator,
Expand Down