Skip to content
Open
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: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ version = "1.4.0"
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"

[weakdeps]
Expand All @@ -23,7 +22,6 @@ Accessors = "0.1"
ArrayInterface = "7"
DocStringExtensions = "0.8, 0.9"
LinearAlgebra = "1.6"
MacroTools = "0.5"
SparseArrays = "1.6"
StaticArraysCore = "1"
julia = "1.10"
2 changes: 1 addition & 1 deletion src/SciMLOperators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using DocStringExtensions
using LinearAlgebra

import ArrayInterface
import MacroTools: @forward
# MacroTools dependency removed - using explicit method forwarding instead
import Accessors: @reset

# overload
Expand Down
20 changes: 10 additions & 10 deletions src/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1001,16 +1001,16 @@ has_mul!(L::InvertedOperator) = has_ldiv!(L.L)
has_ldiv(L::InvertedOperator) = has_mul(L.L)
has_ldiv!(L::InvertedOperator) = has_mul!(L.L)

@forward InvertedOperator.L (
# LinearAlgebra
LinearAlgebra.issymmetric,
LinearAlgebra.ishermitian,
LinearAlgebra.isposdef,
LinearAlgebra.opnorm,

# SciML
isconstant,
has_adjoint)
# Method forwarding for InvertedOperator (previously using @forward from MacroTools)
# LinearAlgebra methods
LinearAlgebra.issymmetric(L::InvertedOperator) = LinearAlgebra.issymmetric(L.L)
LinearAlgebra.ishermitian(L::InvertedOperator) = LinearAlgebra.ishermitian(L.L)
LinearAlgebra.isposdef(L::InvertedOperator) = LinearAlgebra.isposdef(L.L)
LinearAlgebra.opnorm(L::InvertedOperator) = LinearAlgebra.opnorm(L.L)

# SciML methods
isconstant(L::InvertedOperator) = isconstant(L.L)
has_adjoint(L::InvertedOperator) = has_adjoint(L.L)

Base.:*(L::InvertedOperator, u::AbstractVecOrMat) = L.L \ u
Base.:\(L::InvertedOperator, u::AbstractVecOrMat) = L.L * u
Expand Down
26 changes: 13 additions & 13 deletions src/left.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,19 @@ for (op, LType, VType) in ((:adjoint, :AdjointOperator, :AbstractAdjointVecOrMat

@eval getops(L::$LType) = (L.L,)

@eval @forward $LType.L (
# LinearAlgebra
LinearAlgebra.issymmetric,
LinearAlgebra.ishermitian,
LinearAlgebra.isposdef,
LinearAlgebra.opnorm,

# SciML
isconstant,
has_mul,
has_mul!,
has_ldiv,
has_ldiv!)
# Method forwarding (previously using @forward from MacroTools)
# LinearAlgebra methods
@eval LinearAlgebra.issymmetric(L::$LType) = LinearAlgebra.issymmetric(L.L)
@eval LinearAlgebra.ishermitian(L::$LType) = LinearAlgebra.ishermitian(L.L)
@eval LinearAlgebra.isposdef(L::$LType) = LinearAlgebra.isposdef(L.L)
@eval LinearAlgebra.opnorm(L::$LType) = LinearAlgebra.opnorm(L.L)

# SciML methods
@eval isconstant(L::$LType) = isconstant(L.L)
@eval has_mul(L::$LType) = has_mul(L.L)
@eval has_mul!(L::$LType) = has_mul!(L.L)
@eval has_ldiv(L::$LType) = has_ldiv(L.L)
@eval has_ldiv!(L::$LType) = has_ldiv!(L.L)

@eval function cache_internals(L::$LType, u::AbstractVecOrMat)
@reset L.L = cache_operator(L.L, reshape(u, size(L, 1)))
Expand Down
34 changes: 18 additions & 16 deletions src/matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ function Base.similar(L::MatrixOperator, ::Type{T}, dims::Dims) where {T}
end

# traits
@forward MatrixOperator.A (LinearAlgebra.issymmetric,
LinearAlgebra.ishermitian,
LinearAlgebra.isposdef, issquare,
has_ldiv,
has_ldiv!)
# Method forwarding for MatrixOperator (previously using @forward from MacroTools)
LinearAlgebra.issymmetric(L::MatrixOperator) = LinearAlgebra.issymmetric(L.A)
LinearAlgebra.ishermitian(L::MatrixOperator) = LinearAlgebra.ishermitian(L.A)
LinearAlgebra.isposdef(L::MatrixOperator) = LinearAlgebra.isposdef(L.A)
issquare(L::MatrixOperator) = issquare(L.A)
has_ldiv(L::MatrixOperator) = has_ldiv(L.A)
has_ldiv!(L::MatrixOperator) = has_ldiv!(L.A)

isconvertible(::MatrixOperator) = true
islinear(::MatrixOperator) = true
Expand Down Expand Up @@ -408,17 +410,17 @@ getops(L::InvertibleOperator) = (L.L, L.F)
islinear(L::InvertibleOperator) = islinear(L.L)
isconvertible(L::InvertibleOperator) = isconvertible(L.L)

@forward InvertibleOperator.L (
# LinearAlgebra
LinearAlgebra.issymmetric,
LinearAlgebra.ishermitian,
LinearAlgebra.isposdef,

# SciML
isconstant,
has_adjoint,
has_mul,
has_mul!)
# Method forwarding for InvertibleOperator (previously using @forward from MacroTools)
# LinearAlgebra methods
LinearAlgebra.issymmetric(L::InvertibleOperator) = LinearAlgebra.issymmetric(L.L)
LinearAlgebra.ishermitian(L::InvertibleOperator) = LinearAlgebra.ishermitian(L.L)
LinearAlgebra.isposdef(L::InvertibleOperator) = LinearAlgebra.isposdef(L.L)

# SciML methods
isconstant(L::InvertibleOperator) = isconstant(L.L)
has_adjoint(L::InvertibleOperator) = has_adjoint(L.L)
has_mul(L::InvertibleOperator) = has_mul(L.L)
has_mul!(L::InvertibleOperator) = has_mul!(L.L)

has_ldiv(L::InvertibleOperator) = has_mul(L.F)
has_ldiv!(L::InvertibleOperator) = has_ldiv!(L.F)
Expand Down
Loading