1- using LinearSolve, RecursiveFactorization, LinearAlgebra, SparseArrays, Test, JET
1+ using LinearSolve, RecursiveFactorization, LinearAlgebra, SparseArrays, Test
2+
23@test LinearSolve. defaultalg (nothing , zeros (3 )). alg ===
34 LinearSolve. DefaultAlgorithmChoice. GenericLUFactorization
45prob = LinearProblem (rand (3 , 3 ), rand (3 ))
@@ -55,19 +56,7 @@ solve(prob)
5556A = rand (4 , 4 )
5657b = rand (4 )
5758prob = LinearProblem (A, b)
58- VERSION ≥ v " 1.10-" && JET. @test_opt init (prob, nothing )
59- JET. @test_opt solve (prob, LUFactorization ())
60- JET. @test_opt solve (prob, GenericLUFactorization ())
61- @test_skip JET. @test_opt solve (prob, QRFactorization ())
62- JET. @test_opt solve (prob, DiagonalFactorization ())
63- # JET.@test_opt solve(prob, SVDFactorization())
64- # JET.@test_opt solve(prob, KrylovJL_GMRES())
65-
6659prob = LinearProblem (sparse (A), b)
67- # JET.@test_opt solve(prob, UMFPACKFactorization())
68- # JET.@test_opt solve(prob, KLUFactorization())
69- # JET.@test_opt solve(prob, SparspakFactorization())
70- # JET.@test_opt solve(prob)
7160@inferred solve (prob)
7261@inferred init (prob, nothing )
7362
@@ -81,8 +70,8 @@ m, n = 2, 2
8170A = rand (m, n)
8271b = rand (m)
8372x = rand (n)
84- f = (du, u, p, t) -> mul! (du , A, u )
85- fadj = (du, u, p, t) -> mul! (du , A' , u )
73+ f = (w, v, u, p, t) -> mul! (w , A, v )
74+ fadj = (w, v, u, p, t) -> mul! (w , A' , v )
8675funcop = FunctionOperator (f, x, b; op_adjoint = fadj)
8776prob = LinearProblem (funcop, b)
8877sol1 = solve (prob)
@@ -93,8 +82,8 @@ m, n = 3, 2
9382A = rand (m, n)
9483b = rand (m)
9584x = rand (n)
96- f = (du, u, p, t) -> mul! (du , A, u )
97- fadj = (du, u, p, t) -> mul! (du , A' , u )
85+ f = (w, v, u, p, t) -> mul! (w , A, v )
86+ fadj = (w, v, u, p, t) -> mul! (w , A' , v )
9887funcop = FunctionOperator (f, x, b; op_adjoint = fadj)
9988prob = LinearProblem (funcop, b)
10089sol1 = solve (prob)
@@ -105,8 +94,8 @@ m, n = 2, 3
10594A = rand (m, n)
10695b = rand (m)
10796x = rand (n)
108- f = (du, u, p, t) -> mul! (du , A, u )
109- fadj = (du, u, p, t) -> mul! (du , A' , u )
97+ f = (w, v, u, p, t) -> mul! (w , A, v )
98+ fadj = (w, v, u, p, t) -> mul! (w , A' , v )
11099funcop = FunctionOperator (f, x, b; op_adjoint = fadj)
111100prob = LinearProblem (funcop, b)
112101sol1 = solve (prob)
0 commit comments