1
-
2
1
""" user passes in inverse function, and arg symbols """
3
- struct FunctionCall{F,A} <: SciMLLinearSolveAlgorithm
2
+ struct FunctionCall{F,A} <: AbstractFunctionCall
4
3
func!:: F
5
4
argnames:: A
6
5
7
- function FunctionCall (func!:: Function , argnames:: Tuple )
6
+ function FunctionCall (func!:: Function = LinearAlgebra. ldiv!,
7
+ argnames:: Tuple = (:u , :A , :b ),
8
+ )
8
9
# @assert hasfield(::LinearCache, argnames)
9
10
# @assert isdefined
10
11
new {typeof(func!), typeof(argnames)} (func!, argnames)
27
28
# #
28
29
29
30
""" apply ldiv!(A, u) """
30
- struct ApplyLDivBang2Args <: SciMLLinearSolveAlgorithm end
31
+ struct ApplyLDivBang2Args <: AbstractFunctionCall end
31
32
function SciMLBase. solve (cache:: LinearCache , alg:: ApplyLDivBang2Args ,
32
33
args... ; kwargs... )
33
34
@unpack A, b, u = cache
@@ -37,10 +38,12 @@ function SciMLBase.solve(cache::LinearCache, alg::ApplyLDivBang2Args,
37
38
end
38
39
39
40
""" apply ldiv!(u, A, b) """
40
- struct ApplyLDivBang3Args <: SciMLLinearSolveAlgorithm end
41
+ struct ApplyLDivBang3Args <: AbstractFunctionCall end
41
42
function SciMLBase. solve (cache:: LinearCache , alg:: ApplyLDivBang3Args ,
42
43
args... ; kwargs... )
43
44
@unpack A, b, u = cache
44
45
LinearAlgebra. ldiv! (u, A, b)
45
46
return SciMLBase. build_linear_solution (alg,cache. u,nothing ,cache)
46
47
end
48
+
49
+ ApplyLDivBang () = ApplyLDivBang3Args ()
0 commit comments