Skip to content

Commit d33c4a1

Browse files
authored
Merge pull request #7 from ederc/rational-solutions-fixes
Rational solutions fixes
2 parents ce79172 + 3a10af8 commit d33c4a1

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

docs/src/solvers.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,14 @@ The underlying engine is provided by msolve.
4444
info_level::Int=0,
4545
precision::Int=32
4646
)
47+
rational_solutions(
48+
I::Ideal{T} where T <: MPolyElem;
49+
initial_hts::Int=17,
50+
nr_thrds::Int=1,
51+
max_nr_pairs::Int=0,
52+
la_option::Int=2,
53+
info_level::Int=0,
54+
precision::Int=32
55+
)
4756
```
4857

src/algorithms/solvers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,10 @@ julia> rat_sols = rational_solutions(I)
280280
[1//3, 0, 1//3]
281281
282282
julia> map(r->map(p->evaluate(p, r), I.gens), rat_sols)
283-
4-element Vector{Vector{fmpq}}:
283+
2-element Vector{Vector{fmpq}}:
284284
[0, 0, 0]
285285
[0, 0, 0]
286-
286+
```
287287
"""
288288
function rational_solutions(
289289
I::Ideal{T} where T <: MPolyElem; # input generators

src/exports.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export PolynomialRing, MPolyRing, GFElem, MPoly, MPolyElem, FiniteField, GF,
22
characteristic, ZZ, QQ, vars, nvars, ngens, fmpz, fmpq, fmpq_poly,
3-
base_ring, coefficient_ring
3+
base_ring, coefficient_ring, evaluate

src/imports.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Nemo:
1212
divides,
1313
divisor_sigma,
1414
euler_phi,
15+
evaluate,
1516
factorial,
1617
fibonacci,
1718
fits,

test/algorithms/solvers.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
[7087075322218650694049//37778931862957161709568, 1480060550928923391483//18889465931478580854784, 2780329556045248126029//37778931862957161709568, 38421910449864642395061//151115727451828646838272],
1313
[196765270119568550571//590295810358705651712, 0, 1//2361183241434822606848, 787061080478274202283//2361183241434822606848]
1414
]
15+
rat_sols = Vector{fmpq}[[49, 0, 0, 0], [49//3, 0, 0, 1//3]]
16+
1517
@test sols == real_solutions(I)
18+
@test rat_sols == rational_solutions(I)
1619
@test I.real_sols == real_solutions(I)
1720

1821
C, x = PolynomialRing(QQ, "x")

0 commit comments

Comments
 (0)