From af1d31f6e61552b0320c7127ef3c720f75e40dea Mon Sep 17 00:00:00 2001 From: Aaron Fenyes Date: Sat, 10 Feb 2024 14:21:52 -0500 Subject: [PATCH] Test a scale constraint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In all but a few cases (for example, a single point on a plane), we should be able to us the radius-coradius boost symmetry to make the average co-radius—representing the "overall scale"—roughly one. --- engine-proto/Engine.jl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/engine-proto/Engine.jl b/engine-proto/Engine.jl index ba4300c..0b6162e 100644 --- a/engine-proto/Engine.jl +++ b/engine-proto/Engine.jl @@ -210,13 +210,17 @@ function realize(ctx::Construction{T}) where T [elt.rel for (_, elt) in eltenum if !isnothing(elt.rel)] ) - # add relations to center and orient the construction + # add relations to center, orient, and scale the construction if !isempty(ctx.points) append!(eqns, [sum(pt.coords[k] for pt in ctx.points) for k in 1:3]) end if !isempty(ctx.spheres) append!(eqns, [sum(sph.coords[k] for sph in ctx.spheres) for k in 3:4]) end + n_elts = length(ctx.points) + length(ctx.spheres) + if n_elts > 0 + push!(eqns, sum(elt.vec[2] for elt in Iterators.flatten((ctx.points, ctx.spheres))) - n_elts) + end (Generic.Ideal(coordring, eqns), eqns) end @@ -305,10 +309,14 @@ for through_trivial in [false, true] ## [verbose] display(cut_offset) cut_subspace = LinearSubspace(cut_matrix, cut_offset) else - cut_subspace = LinearSubspace(cut_matrix, fill(0, 3)) + cut_subspace = LinearSubspace(cut_matrix, fill(0, freedom)) end wtns = witness_set(system, cut_subspace) - for soln in filter(is_nontrivial, solution.(filter(isreal, results(wtns)))) + real_solns = solution.(filter(isreal, results(wtns))) + nontrivial_solns = filter(is_nontrivial, real_solns) + println("$(length(real_solns) - length(nontrivial_solns)) trivial solutions found") + for soln in nontrivial_solns + ##[test] for soln in filter(is_nontrivial, solution.(filter(isreal, results(wtns)))) if all(norm2(soln - samp) > 1e-4*length(gens(coordring)) for samp in samples) push!(samples, soln) end