Skip to content

Commit c39f57e

Browse files
committed
fix if solution set (not only the real one) is empty, i.e. I = R
1 parent 4f48e3d commit c39f57e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/algorithms/solvers.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ function _core_msolve(
130130
jl_len = Base.unsafe_wrap(Array, res_len[], jl_ld)
131131
nterms = 0
132132

133+
if jl_dquot == 0
134+
I.rat_param = RationalParametrization(Symbol[], fmpz[], fmpq_poly(-1), fmpq_poly(-1), PolyElem[])
135+
I.real_sols = fmpq[]
136+
return I.rat_param, I.real_sols
137+
end
133138
[nterms += jl_len[i] for i=1:jl_ld]
134139
jl_cf = reinterpret(Ptr{BigInt}, res_cf[])
135140
jl_cf_lf = reinterpret(Ptr{BigInt}, res_cf_lf[])

src/types.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@ end
4545
Base.parent(I::Ideal) = Nemo.parent(I.gens[1])
4646

4747
Base.show(io::IO, I::Ideal) = print(io, I.gens)
48+
Base.show(io::IO, R::RationalParametrization) = R.vars == Symbol[] ? print(io, "Solution set is empty") : print(io, R)
4849

4950
Base.getindex(I::Ideal, idx::Int) = I.gens[idx]

0 commit comments

Comments
 (0)