Skip to content

Commit aa015c9

Browse files
committed
fix all tests
1 parent 5c8e914 commit aa015c9

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/graph_polynomials.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ end
3939
function graph_polynomial(gp::GraphProblem, ::Val{:fitting}; usecuda=false,
4040
maxorder = graph_polynomial_maxorder(gp; usecuda=usecuda))
4141
xs = (0:maxorder)
42-
ys = [asscalar(contractx(gp, x; usecuda=usecuda)) for x in xs]
43-
fit(xs, ys, maxorder)
42+
ys = [contractx(gp, x; usecuda=usecuda) for x in xs]
43+
map(ci->fit(xs, getindex.(ys, Ref(ci))), CartesianIndices(ys[1]))
4444
end
4545

4646
function graph_polynomial(gp::GraphProblem, ::Val{:polynomial}; usecuda=false)

test/graph_polynomials.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ end
1818
@testset "independence_polynomial" begin
1919
Random.seed!(2)
2020
g = random_regular_graph(10, 3)
21-
p1 = graph_polynomial(Independence(g), Val(:fitting))
21+
p1 = graph_polynomial(Independence(g), Val(:fitting))[]
2222
p2 = graph_polynomial(Independence(g), Val(:polynomial))[]
23-
p3 = graph_polynomial(Independence(g), Val(:fft))
24-
p4 = graph_polynomial(Independence(g), Val(:finitefield))
23+
p3 = graph_polynomial(Independence(g), Val(:fft))[]
24+
p4 = graph_polynomial(Independence(g), Val(:finitefield))[]
2525
@test p1 p2
2626
@test p1 p3
2727
@test p1 p4
@@ -45,9 +45,9 @@ end
4545

4646
@testset "counting maximal IS" begin
4747
g = random_regular_graph(20, 3)
48-
cs = graph_polynomial(MaximalIndependence, Val(:fft), g; r=1.0, optmethod=:greedy)
48+
cs = graph_polynomial(MaximalIndependence, Val(:fft), g; r=1.0, optmethod=:greedy)[]
4949
cs2 = graph_polynomial(MaximalIndependence, Val(:polynomial), g; optmethod=:greedy)[]
50-
cs3 = graph_polynomial(MaximalIndependence, Val(:finitefield), g; optmethod=:greedy)
50+
cs3 = graph_polynomial(MaximalIndependence, Val(:finitefield), g; optmethod=:greedy)[]
5151
cg = complement(g)
5252
cliques = maximal_cliques(cg)
5353
for i=1:20

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ end
1111

1212
@testset "bounding" begin
1313
include("bounding.jl")
14+
end
15+
16+
@testset "interfaces" begin
17+
include("interfaces.jl")
1418
end

0 commit comments

Comments
 (0)