Skip to content

Commit 9800eac

Browse files
authored
Merge pull request #65 from rprebet/bugfix-param
Fix bug in _get_rational_parametrization
2 parents 896211e + 407616c commit 9800eac

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/algorithms/solvers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function _get_rational_parametrization(
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) * ZZRingElem(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

test/algorithms/solvers.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
[[402853591//2147483648, 805707183//4294967296], [336526807//4294967296, 42065851//536870912], [316086875//4294967296, 79021719//1073741824], [177189787222909921100715117200104483589869//696898287454081973172991196020261297061888, 354379574445819842201430234400208967179739//1393796574908163946345982392040522594123776]],
2121
[[1431655765//4294967296, 715827883//2147483648], [-1//4294967296, 1//4294967296], [-1//4294967296, 1//4294967296], [7259357160980020553885324958544388511061//21778071482940061661655974875633165533184, 3629678580490010276942662479272194255531//10889035741470030830827987437816582766592]]
2222
]
23-
rat_sols = Vector{QQFieldElem}[[49, 0, 0, 0], [49//3, 0, 0, 1//3]]
23+
rat_sols = Vector{QQFieldElem}[[1, 0, 0, 0], [1//3, 0, 0, 1//3]]
2424

2525
@test sols == real_solutions(I)
2626
@test inter_sols == real_solutions(I, interval=true)
@@ -33,9 +33,9 @@
3333
p1 = -3872448*x^7 + 2607552*x^6 - 408528*x^5 - 63088*x^4 + 20224*x^3 - 540*x^2 - 172*x + 7
3434
p2 = -303264*x^7 + 314928*x^6 - 113544*x^5 + 9840*x^4 + 3000*x^3 - 564*x^2 + 12*x
3535
p3 = -699840*x^7 + 449712*x^6 - 74808*x^5 - 1956*x^4 + 1308*x^3 - 174*x^2 + 18*x
36-
p1 *= -7
37-
p2 *= -7
38-
p3 *= -7
36+
p1 *= -1//7
37+
p2 *= -1//7
38+
p3 *= -1//7
3939

4040
param = rational_parametrization(I)
4141

0 commit comments

Comments
 (0)