Skip to content

Commit 9b6df3e

Browse files
authored
Merge pull request #46 from rprebet/fix-bug-permut
Fix bug on variables permutation, when additional variables
2 parents cac388b + fca5ea1 commit 9b6df3e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/algorithms/solvers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ function _core_msolve(
142142

143143
jl_vnames = Base.unsafe_wrap(Array, res_vnames[], jl_rp_nr_vars)
144144
vsymbols = [Symbol(unsafe_string(jl_vnames[i])) for i in 1:jl_rp_nr_vars]
145-
#= get possible variable permutation =#
146-
perm = sortperm(vsymbols)
145+
#= get possible variable permutation, ignoring additional variables=#
146+
perm = sortperm(vsymbols[1:nr_vars])
147147

148148
rat_param = _get_rational_parametrization(jl_ld, jl_len,
149149
jl_cf, jl_cf_lf, jl_rp_nr_vars)

test/algorithms/solvers.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,8 @@
5858
[-1, 0],
5959
[1, 0]
6060
]
61-
@test sols == real_solutions(I)
61+
@test sort(sols) == sort(real_solutions(I))
62+
63+
I = Ideal([x^2-1, y^2])
64+
@test sort(sols) == sort(real_solutions(I))
6265
end

0 commit comments

Comments
 (0)