Skip to content

Commit aaef090

Browse files
committed
Add a test
1 parent eaaf24c commit aaef090

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

test/REQUIRE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
JLD2
2+
FileIO

test/bug.jld2

5.78 KB
Binary file not shown.

test/runtests.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ using Compat, Compat.Test, Compat.LinearAlgebra
22
using Compat.SparseArrays, Compat.DelimitedFiles, Compat.Random
33
using IterativeSolvers, AlgebraicMultigrid
44
import AlgebraicMultigrid: Pinv, Classical
5+
using JLD2
6+
using FileIO
57

68
if VERSION < v"0.7-"
79
const seed! = srand
@@ -304,4 +306,17 @@ for sz in [10, 5, 2]
304306
@test AlgebraicMultigrid.grid_complexity(ml) == 1
305307
end
306308

309+
# Issue #46
310+
for f in (smoothed_aggregation, ruge_stuben)
311+
312+
a = load("bug.jld2")["G"]
313+
ml = f(a)
314+
p = aspreconditioner(ml)
315+
b = zeros(size(a,1))
316+
b[1] = 1
317+
b[2] = -1
318+
@test sum(abs2, a * solve(ml, b) - b) < 1e-10
319+
320+
end
321+
307322
end

0 commit comments

Comments
 (0)