@@ -10,6 +10,8 @@ using AlgebraicMultigrid
1010using IncompleteLU
1111using IterativeSolvers
1212
13+ using LinearSolve
14+
1315# #############################################################
1416@testset " Constructors" begin
1517 function test_constructors ()
320322 @test test_hermitian (300 ,:L )
321323end
322324
323- function test_lu1 (k,l,m; lufac= LUFactorization ())
325+ function test_lu1 (k,l,m; lufac= ExtendableSparse . LUFactorization ())
324326 Acsc= fdrand (k,l,m,rand= ()-> 1 ,matrixtype= SparseMatrixCSC)
325327 b= rand (k* l* m)
326328 LUcsc= lu (Acsc)
@@ -342,7 +344,7 @@ function test_lu1(k,l,m; lufac=LUFactorization())
342344 x1csc≈ x1ext && x2csc ≈ x2ext
343345end
344346
345- function test_lu2 (k,l,m;lufac= LUFactorization ())
347+ function test_lu2 (k,l,m;lufac= ExtendableSparse . LUFactorization ())
346348 Aext= fdrand (k,l,m,rand= ()-> 1 ,matrixtype= ExtendableSparseMatrix)
347349 b= rand (k* l* m)
348350 lu! (lufac,Aext)
@@ -357,7 +359,7 @@ function test_lu2(k,l,m;lufac=LUFactorization())
357359end
358360
359361
360- @testset " LUFactorization" begin
362+ @testset " ExtendableSparse. LUFactorization" begin
361363 @test test_lu1 (10 ,10 ,10 )
362364 @test test_lu1 (25 ,40 ,1 )
363365 @test test_lu1 (1000 ,1 ,1 )
432434 @test test_parilu0 (1000 )
433435end
434436
437+
438+ function test_linearsolve (n)
439+
440+ A= fdrand (n,1 ,1 , matrixtype= ExtendableSparseMatrix)
441+ b= rand (n)
442+ c= A\ b
443+ @test c ≈ LinearSolve. solve (LinearProblem (A,b)). u
444+
445+ A= fdrand (n,n,1 , matrixtype= ExtendableSparseMatrix)
446+ b= rand (n* n)
447+ c= A\ b
448+ @test c ≈ LinearSolve. solve (LinearProblem (A,b)). u
449+
450+ @test c ≈ LinearSolve. solve (LinearProblem (A,b),UMFPACKFactorization ()). u
451+ @test c ≈ LinearSolve. solve (LinearProblem (A,b),KLUFactorization ()). u
452+ @test c ≈ LinearSolve. solve (LinearProblem (A,b),IterativeSolversJL_CG (),Pl= ILU0Preconditioner (A)). u
453+ @test c ≈ LinearSolve. solve (LinearProblem (A,b),IterativeSolversJL_CG (),Pl= JacobiPreconditioner (A)). u
454+ @test c ≈ LinearSolve. solve (LinearProblem (A,b),IterativeSolversJL_CG (),Pl= ParallelJacobiPreconditioner (A)). u
455+ @test c ≈ LinearSolve. solve (LinearProblem (A,b),IterativeSolversJL_CG (),Pl= ILUTPreconditioner (A)). u
456+ @test c ≈ LinearSolve. solve (LinearProblem (A,b),IterativeSolversJL_CG (),Pl= AMGPreconditioner (A)). u
457+
458+
459+ end
460+
461+ @testset " LinearSolve" begin
462+ test_linearsolve (20 )
463+ end
0 commit comments