Skip to content

Commit fe0f0d1

Browse files
authored
Merge pull request #588 from oskarhenriksson/fix_small_nid_bugs
2 parents 2fc4851 + e0c9edd commit fe0f0d1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/numerical_irreducible_decomposition.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,15 +1126,15 @@ function n_components(
11261126
else
11271127
out = 0
11281128
for d in dims
1129-
if haskey(D, k)
1130-
out += sum(length(last(Ws)) for Ws in D[d])
1129+
if haskey(D, d)
1130+
out += length(D[d])
11311131
end
11321132
end
11331133
end
11341134

11351135
out
11361136
end
1137-
n_components(N::NumericalIrreducibleDecomposition, dim::Int) = n_components(N, [dim])
1137+
n_components(N::NumericalIrreducibleDecomposition, dim::Int) = n_components(N, dims = [dim])
11381138

11391139
"""
11401140

test/nid_test.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@
5353

5454
N3 = nid(F; monodromy_options = MonodromyOptions(; trace_test_tol = 1e-12))
5555
@test isa(N3, NumericalIrreducibleDecomposition)
56+
57+
# number of components
58+
@test n_components(N3) == 4
59+
@test n_components(N3, dims = [1, 2]) == 3
60+
@test n_components(N3, 1) == 2
5661
end
5762

5863
@testset "Hypersurface of degree 5" begin

0 commit comments

Comments
 (0)