Skip to content

Commit f07c9a1

Browse files
committed
create and export isconstant
1 parent a50d084 commit f07c9a1

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/SciMLOperators.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ export ScalarOperator,
5656
export update_coefficients!,
5757
update_coefficients,
5858

59+
isconstant,
60+
5961
cache_operator,
6062

6163
has_adjoint,

src/interface.jl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,18 @@ has_ldiv!(L::AbstractSciMLOperator) = false # ldiv!(du, L, u)
9393

9494
### Extra standard assumptions
9595

96-
isconstant(L) = true
96+
isconstant(::Union{
97+
# LinearAlgebra
98+
AbstractMatrix,
99+
UniformScaling,
100+
Factorization,
101+
102+
# Base
103+
Number,
104+
105+
}
106+
) = true
97107
isconstant(L::AbstractSciMLOperator) = all(isconstant, getops(L))
98-
#isconstant(L::AbstractSciMLOperator) = L.update_func = DEFAULT_UPDATE_FUNC
99108

100109
islinear(L) = false
101110
islinear(::Union{

0 commit comments

Comments
 (0)