@@ -131,8 +131,8 @@ function _convert_rational_array_to_abstract_algebra(
131131 bcf:: Vector{QQFieldElem} ,
132132 bexp:: Vector{Int32} ,
133133 R:: MPolyRing ,
134- eliminate :: Int = 0 ,
135- normalize :: Bool = false
134+ normalize :: Bool = false ,
135+ eliminate :: Int = 0
136136 )
137137
138138 if characteristic (R) != 0
@@ -152,7 +152,6 @@ function _convert_rational_array_to_abstract_algebra(
152152 z = zeros (Int, eliminate)
153153 end
154154 for i in 1 : nr_gens
155- println (" i " , i)
156155 #= check if element is part of the eliminated basis =#
157156 if eliminate > 0
158157 cmp = convert (Vector{Int}, bexp[(len)* nr_vars+ 1 : (len+ 1 )* nr_vars])
@@ -165,18 +164,17 @@ function _convert_rational_array_to_abstract_algebra(
165164 else
166165 g = MPolyBuildCtx (R)
167166 lc = bcf[len+ 1 ]
168- if normalize && lc == 1
169- for j in 1 : blen[i]
170- println ( " j " , j)
171- push_term! (g, bcf[len+ j],
172- convert (Vector{Int}, bexp[(len+ j- 1 )* nr_vars+ 1 : (len+ j)* nr_vars]))
173- end
167+
168+ if normalize && lc != 1
169+ for j in 1 : blen[i]
170+ push_term! (g, bcf[len+ j]/ lc ,
171+ convert (Vector{Int}, bexp[(len+ j- 1 )* nr_vars+ 1 : (len+ j)* nr_vars]))
172+ end
174173 else
175- for j in 1 : blen[i]
176- println (" j " , j)
177- push_term! (g, bcf[len+ j]/ lc,
178- convert (Vector{Int}, bexp[(len+ j- 1 )* nr_vars+ 1 : (len+ j)* nr_vars]))
179- end
174+ for j in 1 : blen[i]
175+ push_term! (g, bcf[len+ j],
176+ convert (Vector{Int}, bexp[(len+ j- 1 )* nr_vars+ 1 : (len+ j)* nr_vars]))
177+ end
180178 end
181179 push! (basis, finish (g))
182180 end
0 commit comments