Skip to content

Commit deb15e4

Browse files
committed
first documentation for rational_solutions
1 parent 6423b8b commit deb15e4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/algorithms/solvers.jl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,35 @@ end
254254
Given an ideal `I` with a finite solution set over the complex numbers, return
255255
the rational roots of the ideal.
256256
257+
# Arguments
258+
- `I::Ideal{T} where T <: MPolyElem`: input generators.
259+
- `initial_hts::Int=17`: initial hash table size `log_2`.
260+
- `nr_thrds::Int=1`: number of threads for parallel linear algebra.
261+
- `max_nr_pairs::Int=0`: maximal number of pairs per matrix, only bounded by minimal degree if `0`.
262+
- `la_option::Int=2`: linear algebra option: exact sparse-dense (`1`), exact sparse (`2`, default), probabilistic sparse-dense (`42`), probabilistic sparse(`44`).
263+
- `info_level::Int=0`: info level printout: off (`0`, default), summary (`1`), detailed (`2`).
264+
- `precision::Int=32`: bit precision for the computed solutions.
265+
266+
# Examples
267+
```jldoctest
268+
julia> using AlgebraicSolving
269+
270+
julia> R,(x1,x2,x3) = PolynomialRing(QQ, ["x1","x2","x3"])
271+
(Multivariate Polynomial Ring in x1, x2, x3 over Rational Field, Nemo.fmpq_mpoly[x1, x2, x3])
272+
273+
julia> I = Ideal([x1+2*x2+2*x3-1, x1^2+2*x2^2+2*x3^2-x1, 2*x1*x2+2*x2*x3-x2])
274+
Nemo.fmpq_mpoly[x1 + 2*x2 + 2*x3 - 1, x1^2 - x1 + 2*x2^2 + 2*x3^2, 2*x1*x2 + 2*x2*x3 - x2]
275+
276+
julia> rat_sols = rational_solutions(I)
277+
2-element Vector{Vector{fmpq}}:
278+
[1, 0, 0]
279+
[1//3, 0, 1//3]
280+
281+
julia> map(r->map(p->evaluate(p, r), I.gens), rat_sols)
282+
4-element Vector{Vector{fmpq}}:
283+
[0, 0, 0]
284+
[0, 0, 0]
285+
257286
"""
258287
function rational_solutions(
259288
I::Ideal{T} where T <: MPolyElem; # input generators

0 commit comments

Comments
 (0)