@@ -17,11 +17,11 @@ function _get_rational_parametrization(
1717 nr_vars:: Int32
1818 )
1919 if cfs_lf != Ptr {BigInt} (0 )
20- lf = [fmpz (unsafe_load (cfs_lf, i)) for i in 1 : nr_vars]
20+ lf = [ZZRingElem (unsafe_load (cfs_lf, i)) for i in 1 : nr_vars]
2121 else
22- lf = fmpz []
22+ lf = ZZRingElem []
2323 end
24- C, x = PolynomialRing (QQ," x" )
24+ C, x = polynomial_ring (QQ," x" )
2525 ctr = 0
2626
2727 elim = C ([unsafe_load (cfs, i) for i in 1 : lens[1 ]])
@@ -31,13 +31,13 @@ function _get_rational_parametrization(
3131 ctr += lens[2 ]
3232
3333 size = nr- 2
34- p = Vector {PolyElem } (undef, size)
34+ p = Vector {PolyRingElem } (undef, size)
3535 k = 1
3636 for i in 3 : nr
3737 p[k] = C ([unsafe_load (cfs, j+ ctr) for j in 1 : lens[i]- 1 ])
3838 # multiply parametrization polynomial directly with
3939 # corresponding coefficients
40- p[k] *= (- 1 ) * fmpz (unsafe_load (cfs, lens[i]+ ctr))
40+ p[k] *= (- 1 ) * ZZRingElem (unsafe_load (cfs, lens[i]+ ctr))
4141 ctr += lens[i]
4242 k += 1
4343 end
@@ -46,14 +46,14 @@ function _get_rational_parametrization(
4646end
4747
4848@doc Markdown. doc"""
49- _core_msolve(I::Ideal{T} where T <: MPolyElem , <keyword arguments>)
49+ _core_msolve(I::Ideal{T} where T <: MPolyRingElem , <keyword arguments>)
5050
5151Compute a rational parametrization and the real solutions of the ideal `I` via msolve.
5252
5353**Note**: This is an internal function.
5454"""
5555function _core_msolve (
56- I:: Ideal{T} where T <: MPolyElem ; # input generators
56+ I:: Ideal{T} where T <: MPolyRingElem ; # input generators
5757 initial_hts:: Int = 17 , # hash table size, default 2^17
5858 nr_thrds:: Int = 1 , # number of threads
5959 max_nr_pairs:: Int = 0 , # number of pairs maximally chosen
@@ -131,9 +131,9 @@ function _core_msolve(
131131 nterms = 0
132132
133133 if jl_dquot == 0
134- C,x = PolynomialRing (QQ," x" )
135- I. rat_param = RationalParametrization (Symbol[], fmpz [], C (- 1 ), C (- 1 ), PolyElem [])
136- I. real_sols = fmpq []
134+ C,x = polynomial_ring (QQ," x" )
135+ I. rat_param = RationalParametrization (Symbol[], ZZRingElem [], C (- 1 ), C (- 1 ), PolyRingElem [])
136+ I. real_sols = QQFieldElem []
137137 return I. rat_param, I. real_sols
138138 end
139139 [nterms += jl_len[i] for i= 1 : jl_ld]
@@ -150,8 +150,8 @@ function _core_msolve(
150150 I. rat_param = RationalParametrization (vsymbols, rat_param[1 ],rat_param[2 ],
151151 rat_param[3 ], rat_param[4 ])
152152 if jl_nb_sols == 0
153- I. real_sols = fmpq []
154- return rat_param, Vector{fmpq }[]
153+ I. real_sols = QQFieldElem []
154+ return rat_param, Vector{QQFieldElem }[]
155155 end
156156
157157 # get solutions
@@ -164,17 +164,17 @@ function _core_msolve(
164164
165165 #= solutions are returned as intervals, i.e. a minimum and a maximum entry for
166166 = the numerator and denominator; thus we sum up and divide by =#
167- solutions = Vector {Vector{fmpq }} (undef, jl_nb_sols)
167+ solutions = Vector {Vector{QQFieldElem }} (undef, jl_nb_sols)
168168
169169 len = 2 * jl_nb_sols* nr_vars
170170 i = 1
171171 k = 1
172172 while i <= len
173173 j = 1
174- tmp = Vector {Nemo.fmpq } (undef, nr_vars)
174+ tmp = Vector {Nemo.QQFieldElem } (undef, nr_vars)
175175 while j <= nr_vars
176- tmp[j] = fmpq (unsafe_load (jl_sols_num, i)) >> Int64 (unsafe_load (jl_sols_den, i))
177- tmp[j] += fmpq (unsafe_load (jl_sols_num, i+ 1 )) >> Int64 (unsafe_load (jl_sols_den, i+ 1 ))
176+ tmp[j] = QQFieldElem (unsafe_load (jl_sols_num, i)) >> Int64 (unsafe_load (jl_sols_den, i))
177+ tmp[j] += QQFieldElem (unsafe_load (jl_sols_num, i+ 1 )) >> Int64 (unsafe_load (jl_sols_den, i+ 1 ))
178178 tmp[j] = tmp[j] >> 1
179179 i += 2
180180 j += 1
@@ -194,7 +194,7 @@ function _core_msolve(
194194end
195195
196196@doc Markdown. doc"""
197- rational_parametrization(I::Ideal{T} where T <: MPolyElem , <keyword arguments>)
197+ rational_parametrization(I::Ideal{T} where T <: MPolyRingElem , <keyword arguments>)
198198
199199Given an ideal `I` with a finite solution set over the complex numbers, return
200200the rational parametrization of the ideal with a given precision (default 32 bits).
@@ -203,7 +203,7 @@ the rational parametrization of the ideal with a given precision (default 32 bit
203203is greater then zero an empty array is returned.
204204
205205# Arguments
206- - `I::Ideal{T} where T <: MPolyElem `: input generators.
206+ - `I::Ideal{T} where T <: MPolyRingElem `: input generators.
207207- `initial_hts::Int=17`: initial hash table size `log_2`.
208208- `nr_thrds::Int=1`: number of threads for parallel linear algebra.
209209- `max_nr_pairs::Int=0`: maximal number of pairs per matrix, only bounded by minimal degree if `0`.
@@ -215,7 +215,7 @@ is greater then zero an empty array is returned.
215215```jldoctest
216216julia> using AlgebraicSolving
217217
218- julia> R,(x1,x2,x3) = PolynomialRing (QQ, ["x1","x2","x3"])
218+ julia> R,(x1,x2,x3) = polynomial_ring (QQ, ["x1","x2","x3"])
219219(Multivariate polynomial ring in 3 variables over QQ, Nemo.QQMPolyRingElem[x1, x2, x3])
220220
221221julia> I = Ideal([x1+2*x2+2*x3-1, x1^2+2*x2^2+2*x3^2-x1, 2*x1*x2+2*x2*x3-x2])
@@ -226,7 +226,7 @@ AlgebraicSolving.RationalParametrization([:x1, :x2, :x3], Nemo.ZZRingElem[], 84*
226226```
227227"""
228228function rational_parametrization (
229- I:: Ideal{T} where T <: MPolyElem ; # input generators
229+ I:: Ideal{T} where T <: MPolyRingElem ; # input generators
230230 initial_hts:: Int = 17 , # hash table size, default 2^17
231231 nr_thrds:: Int = 1 , # number of threads
232232 max_nr_pairs:: Int = 0 , # number of pairs maximally chosen
@@ -250,13 +250,13 @@ end
250250
251251
252252@doc Markdown. doc"""
253- rational_solutions(I::Ideal{T} where T <: MPolyElem , <keyword arguments>)
253+ rational_solutions(I::Ideal{T} where T <: MPolyRingElem , <keyword arguments>)
254254
255255Given an ideal `I` with a finite solution set over the complex numbers, return
256256the rational roots of the ideal.
257257
258258# Arguments
259- - `I::Ideal{T} where T <: MPolyElem `: input generators.
259+ - `I::Ideal{T} where T <: MPolyRingElem `: input generators.
260260- `initial_hts::Int=17`: initial hash table size `log_2`.
261261- `nr_thrds::Int=1`: number of threads for parallel linear algebra.
262262- `max_nr_pairs::Int=0`: maximal number of pairs per matrix, only bounded by minimal degree if `0`.
@@ -268,7 +268,7 @@ the rational roots of the ideal.
268268```jldoctest
269269julia> using AlgebraicSolving
270270
271- julia> R,(x1,x2,x3) = PolynomialRing (QQ, ["x1","x2","x3"])
271+ julia> R,(x1,x2,x3) = polynomial_ring (QQ, ["x1","x2","x3"])
272272(Multivariate polynomial ring in 3 variables over QQ, Nemo.QQMPolyRingElem[x1, x2, x3])
273273
274274julia> I = Ideal([x1+2*x2+2*x3-1, x1^2+2*x2^2+2*x3^2-x1, 2*x1*x2+2*x2*x3-x2])
@@ -286,7 +286,7 @@ julia> map(r->map(p->evaluate(p, r), I.gens), rat_sols)
286286```
287287"""
288288function rational_solutions (
289- I:: Ideal{T} where T <: MPolyElem ; # input generators
289+ I:: Ideal{T} where T <: MPolyRingElem ; # input generators
290290 initial_hts:: Int = 17 , # hash table size, default 2^17
291291 nr_thrds:: Int = 1 , # number of threads
292292 max_nr_pairs:: Int = 0 , # number of pairs maximally chosen
@@ -313,12 +313,12 @@ function rational_solutions(
313313 rat_den = map (l-> evaluate (param_t. denom, l), rat_elim)
314314 rat_num = map (r-> map (l-> evaluate (l, r), param_t. param), rat_elim)
315315
316- rat_sols = Vector {Vector{fmpq }} (undef, nb)
316+ rat_sols = Vector {Vector{QQFieldElem }} (undef, nb)
317317
318318 if length (param_t. vars) == parent (I). nvars
319319
320320 for i in 1 : nb
321- rat_sols[i] = Vector {fmpq } (undef, nvars)
321+ rat_sols[i] = Vector {QQFieldElem } (undef, nvars)
322322 for j in 1 : (nvars- 1 )
323323 rat_sols[i][j] = rat_num[i][j] // rat_den[i]
324324 end
@@ -328,7 +328,7 @@ function rational_solutions(
328328 else
329329
330330 for i in 1 : nb
331- rat_sols[i] = Vector {fmpq } (undef, nvars - 1 )
331+ rat_sols[i] = Vector {QQFieldElem } (undef, nvars - 1 )
332332 for j in 1 : (nvars- 1 )
333333 rat_sols[i][j] = rat_num[i][j] // rat_den[i]
334334 end
343343
344344
345345@doc Markdown. doc"""
346- real_solutions(I::Ideal{T} where T <: MPolyElem , <keyword arguments>)
346+ real_solutions(I::Ideal{T} where T <: MPolyRingElem , <keyword arguments>)
347347
348348Given an ideal `I` with a finite solution set over the complex numbers, return
349349the real roots of the ideal with a given precision (default 32 bits).
@@ -352,7 +352,7 @@ the real roots of the ideal with a given precision (default 32 bits).
352352is greater than zero an empty array is returned.
353353
354354# Arguments
355- - `I::Ideal{T} where T <: MPolyElem `: input generators.
355+ - `I::Ideal{T} where T <: MPolyRingElem `: input generators.
356356- `initial_hts::Int=17`: initial hash table size `log_2`.
357357- `nr_thrds::Int=1`: number of threads for parallel linear algebra.
358358- `max_nr_pairs::Int=0`: maximal number of pairs per matrix, only bounded by minimal degree if `0`.
@@ -364,7 +364,7 @@ is greater than zero an empty array is returned.
364364```jldoctest
365365julia> using AlgebraicSolving
366366
367- julia> R,(x1,x2,x3) = PolynomialRing (QQ, ["x1","x2","x3"])
367+ julia> R,(x1,x2,x3) = polynomial_ring (QQ, ["x1","x2","x3"])
368368(Multivariate polynomial ring in 3 variables over QQ, Nemo.QQMPolyRingElem[x1, x2, x3])
369369
370370julia> I = Ideal([x1+2*x2+2*x3-1, x1^2+2*x2^2+2*x3^2-x1, 2*x1*x2+2*x2*x3-x2])
@@ -379,7 +379,7 @@ julia> real_solutions(I)
379379```
380380"""
381381function real_solutions (
382- I:: Ideal{T} where T <: MPolyElem ; # input generators
382+ I:: Ideal{T} where T <: MPolyRingElem ; # input generators
383383 initial_hts:: Int = 17 , # hash table size, default 2^17
384384 nr_thrds:: Int = 1 , # number of threads
385385 max_nr_pairs:: Int = 0 , # number of pairs maximally chosen
0 commit comments