Skip to content

Commit

Permalink
add ACR test
Browse files Browse the repository at this point in the history
  • Loading branch information
PBrdng committed May 24, 2024
1 parent 9fb6d91 commit 48dab0e
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/numerical_irreducible_decomposition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ function update_progress!(progress::WitnessSetsProgress, i::Int, m::Int)
)
end
update_progress!(progress::Nothing, W::WitnessPoints) = nothing
function update_progress!(progress::WitnessSetsProgress, W::WitnessPoints)
progress.degrees[codim(W)] = length(points(W))
function update_progress!(progress::WitnessSetsProgress, W::Union{WitnessPoints,WitnessSet})
progress.degrees[codim(W)] = length(solutions(W))

Check warning on line 100 in src/numerical_irreducible_decomposition.jl

View check run for this annotation

Codecov / codecov/patch

src/numerical_irreducible_decomposition.jl#L99-L100

Added lines #L99 - L100 were not covered by tests
PM.update!(
progress.progress_meter,
progress.current_codim,
Expand Down Expand Up @@ -130,7 +130,10 @@ function showvalues(progress::WitnessSetsProgress)
push!(text, ("Current number of witness points", ""))
for c = 1:progress.codim
d = progress.ambient_dim - c
push!(text, ("Dimension $d", "$(get(progress.degrees, c, "-"))"))
deg = get(progress.degrees, c, nothing)
if !isnothing(deg) && deg > 0
push!(text, ("Dimension $d", "$(deg)"))

Check warning on line 135 in src/numerical_irreducible_decomposition.jl

View check run for this annotation

Codecov / codecov/patch

src/numerical_irreducible_decomposition.jl#L133-L135

Added lines #L133 - L135 were not covered by tests
end
end
end

Expand Down Expand Up @@ -477,7 +480,7 @@ function regeneration!(
n,
codim,
PM.ProgressUnknown(
dt = 0.2,
dt = 1.0,
desc = "Computing witness sets...",
enabled = true,
spinner = true,
Expand Down Expand Up @@ -590,14 +593,16 @@ function regeneration!(
end
end
pop!(vars)
finish_progress!(progress)


filter!(W -> degree(W) > 0, out)

if !isempty(out)
return map(out) do W
P, L = u_transform(W)

# here comes an additional safety feature:
# after regeneration we apply one additional monodromy per witness set to find potential missing solutions
if dim(L) < n
MS = MonodromySolver(F, L; compile = false)
res = monodromy_solve(

Check warning on line 608 in src/numerical_irreducible_decomposition.jl

View check run for this annotation

Codecov / codecov/patch

src/numerical_irreducible_decomposition.jl#L606-L608

Added lines #L606 - L608 were not covered by tests
Expand All @@ -608,8 +613,14 @@ function regeneration!(
threading = threading,
show_progress = false,
)
return WitnessSet(fixed(F, compile = false), L, solutions(res))

W = WitnessSet(fixed(F, compile = false), L, solutions(res))
update_progress!(progress, W)

Check warning on line 618 in src/numerical_irreducible_decomposition.jl

View check run for this annotation

Codecov / codecov/patch

src/numerical_irreducible_decomposition.jl#L617-L618

Added lines #L617 - L618 were not covered by tests

finish_progress!(progress)
return W

Check warning on line 621 in src/numerical_irreducible_decomposition.jl

View check run for this annotation

Codecov / codecov/patch

src/numerical_irreducible_decomposition.jl#L620-L621

Added lines #L620 - L621 were not covered by tests
else
finish_progress!(progress)
return WitnessSet(fixed(F, compile = false), L, P)

Check warning on line 624 in src/numerical_irreducible_decomposition.jl

View check run for this annotation

Codecov / codecov/patch

src/numerical_irreducible_decomposition.jl#L623-L624

Added lines #L623 - L624 were not covered by tests
end

Expand Down
41 changes: 41 additions & 0 deletions test/nid_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,47 @@
@test n_components(N_Bricard6R) == 1
end

@testset "ACR" begin
@var xx_Di, xx_Da, xx_Ya, xx_Yi
@var xx_CXY, xx_CXYp, xx_G, xx_CNA, xx_X
@var xx_A, xx_N, xx_CXA, xx_T, xx_CXT, xx_Xp


F_ACR = [
-(5 / 3) * xx_Di + (2 / 3) * xx_Da,
(5 / 3) * xx_Di - (2 / 3) * xx_Da,
-(1 / 3) * xx_Ya * xx_X - (2 / 3) * xx_Ya +
(5 / 6) * xx_Yi +
(6 / 5) * xx_CXY +
4 * xx_CXYp,
-8 * xx_Da * xx_Yi + (5 / 7) * xx_G * xx_CNA + (2 / 3) * xx_Ya -
(49 / 30) * xx_Yi,
8 * xx_Da * xx_Yi - (5 / 7) * xx_G * xx_CNA + (4 / 5) * xx_Yi,
8 * xx_Da * xx_Yi - (5 / 7) * xx_G * xx_CNA +
(2 / 3) * xx_A * xx_N +
(4 / 5) * xx_Yi - (8 / 3) * xx_CNA,
-(2 / 3) * xx_A * xx_N - (7 / 8) * xx_A * xx_X +
(8 / 3) * xx_CNA +
(5 / 7) * xx_CXA,
-(2 / 3) * xx_A * xx_N + (8 / 3) * xx_CNA - (5 / 2) * xx_N + 1,
-(1 / 3) * xx_Ya * xx_X - (7 / 8) * xx_A * xx_X - xx_X * xx_T - (4 / 3) * xx_X +
(6 / 5) * xx_CXY +
3 * xx_CXT +
(5 / 7) * xx_CXA +
1,
(1 / 3) * xx_Ya * xx_X - (26 / 5) * xx_CXY,
4 * xx_CXY - 4 * xx_CXYp,
4 * xx_CXYp - 5 * xx_Xp,
-xx_X * xx_T + 3 * xx_CXT,
xx_X * xx_T - 3 * xx_CXT,
(7 / 8) * xx_A * xx_X - (5 / 7) * xx_CXA,
]

N_ACR = nid(F_ACR)
degrees(N_ACR) == Dict(4 => [7])
end


# @testset "426" begin
# ### Example thanks to Julian Vill
# @var a, b, c, d, e
Expand Down

0 comments on commit 48dab0e

Please sign in to comment.