Engine prototype #13

Merged
glen merged 133 commits from engine-proto into main 2024-10-21 03:18:48 +00:00
Showing only changes of commit af1d31f6e6 - Show all commits

View File

@ -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