@@ -120,24 +120,24 @@ fsmoother = GaussSeidel(ForwardSweep())
120120A = poisson (1000 )
121121A = float .(A)
122122ml = ruge_stuben (A)
123- x = solve (ml, A * ones (1000 ))
123+ x = AlgebraicMultigrid . _solve (ml, A * ones (1000 ))
124124@test sum (abs2, x - ones (1000 )) < 1e-8
125125
126126ml = ruge_stuben (A, presmoother = fsmoother,
127127 postsmoother = fsmoother)
128- x = solve (ml, A * ones (1000 ))
128+ x = AlgebraicMultigrid . _solve (ml, A * ones (1000 ))
129129@test sum (abs2, x - ones (1000 )) < 1e-8
130130
131131
132132A = include (" randlap.jl" )
133133
134134ml = ruge_stuben (A, presmoother = fsmoother,
135135 postsmoother = fsmoother)
136- x = solve (ml, A * ones (100 ))
136+ x = AlgebraicMultigrid . _solve (ml, A * ones (100 ))
137137@test sum (abs2, x - zeros (100 )) < 1e-8
138138
139139ml = ruge_stuben (A)
140- x = solve (ml, A * ones (100 ))
140+ x = AlgebraicMultigrid . _solve (ml, A * ones (100 ))
141141@test sum (abs2, x - zeros (100 )) < 1e-6
142142
143143
@@ -155,7 +155,7 @@ p = aspreconditioner(ml)
155155b = zeros (n)
156156b[1 ] = 1
157157b[2 ] = - 1
158- x = solve (p . ml, A * ones (n), maxiter = 1 , abstol = 1e-12 )
158+ x = AlgebraicMultigrid . _solve ( ml, A * ones (n), maxiter = 1 , abstol = 1e-12 )
159159diff = x - [ 1.88664780e-16 , 2.34982727e-16 , 2.33917697e-16 ,
160160 8.77869044e-17 , 7.16783490e-17 , 1.43415460e-16 ,
161161 3.69199021e-17 , 9.70950385e-17 , 4.77034895e-17 ,
@@ -173,7 +173,9 @@ diff = x - [ 1.88664780e-16, 2.34982727e-16, 2.33917697e-16,
173173 - 6.76965535e-16 , - 7.00643227e-16 , - 6.23581397e-16 ,
174174 - 7.03016682e-16 ]
175175@test sum (abs2, diff) < 1e-8
176- x = solve (p. ml, b, maxiter = 1 , abstol = 1e-12 )
176+ x = solve (A, b, RugeStubenAMG (); presmoother = smoother,
177+ postsmoother = smoother,
178+ maxiter = 1 , abstol = 1e-12 )
177179diff = x - [ 0.76347046 , - 0.5498286 , - 0.2705487 , - 0.15047352 , - 0.10248021 ,
178180 0.60292674 , - 0.11497073 , - 0.08460548 , - 0.06931461 , 0.38230708 ,
179181 - 0.055664 , - 0.04854558 , - 0.04577031 , 0.09964325 , 0.01825624 ,
@@ -214,7 +216,7 @@ diff = x - [0.823762, -0.537478, -0.306212, -0.19359, -0.147621, 0.685002,
214216 0.0511691 , 0.0502043 , 0.0498349 , 0.0498134 ]
215217@test sum (abs2, diff) < 1e-8
216218
217- x = solve (ml, b, maxiter = 1 , reltol = 1e-12 )
219+ x = AlgebraicMultigrid . _solve (ml, b, maxiter = 1 , reltol = 1e-12 )
218220diff = x - [0.775725 , - 0.571202 , - 0.290989 , - 0.157001 , - 0.106981 , 0.622652 ,
219221 - 0.122318 , - 0.0891874 , - 0.0709834 , 0.392621 , - 0.055544 , - 0.0507485 ,
220222 - 0.0466376 , 0.107175 , 0.0267468 , - 0.0200843 , - 0.0282827 , - 0.0299929 ,
@@ -240,7 +242,7 @@ for (T,V) in ((Float64, Float64), (Float32,Float32),
240242 ml = smoothed_aggregation (a)
241243 b = V .(b)
242244 c = cg (a, b, maxiter = 10 )
243- @test eltype (solve (ml, b)) == eltype (c)
245+ @test eltype (AlgebraicMultigrid . _solve (ml, b)) == eltype (c)
244246end
245247
246248end
@@ -316,7 +318,7 @@ for f in (smoothed_aggregation, ruge_stuben)
316318 b = zeros (size (a,1 ))
317319 b[1 ] = 1
318320 b[2 ] = - 1
319- @test sum (abs2, a * solve (ml, b) - b) < 1e-10
321+ @test sum (abs2, a * AlgebraicMultigrid . _solve (ml, b) - b) < 1e-10
320322 @test sum (abs2, a * cg (a, b, Pl = p, maxiter = 1000 ) - b) < 1e-10
321323
322324end
0 commit comments