Skip to content

Commit

Permalink
Merge pull request #65 from rprebet/bugfix-param
Browse files Browse the repository at this point in the history
Fix bug in  _get_rational_parametrization
  • Loading branch information
mohabsafey committed Jul 17, 2024
2 parents 896211e + 407616c commit 9800eac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/algorithms/solvers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function _get_rational_parametrization(
p[k] = C([unsafe_load(cfs, j+ctr) for j in 1:lens[i]-1])
# multiply parametrization polynomial directly with
# corresponding coefficients
p[k] *= (-1) * ZZRingElem(unsafe_load(cfs, lens[i]+ctr))
p[k] *= (-1) // ZZRingElem(unsafe_load(cfs, lens[i]+ctr))
ctr += lens[i]
k += 1
end
Expand Down
8 changes: 4 additions & 4 deletions test/algorithms/solvers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[[402853591//2147483648, 805707183//4294967296], [336526807//4294967296, 42065851//536870912], [316086875//4294967296, 79021719//1073741824], [177189787222909921100715117200104483589869//696898287454081973172991196020261297061888, 354379574445819842201430234400208967179739//1393796574908163946345982392040522594123776]],
[[1431655765//4294967296, 715827883//2147483648], [-1//4294967296, 1//4294967296], [-1//4294967296, 1//4294967296], [7259357160980020553885324958544388511061//21778071482940061661655974875633165533184, 3629678580490010276942662479272194255531//10889035741470030830827987437816582766592]]
]
rat_sols = Vector{QQFieldElem}[[49, 0, 0, 0], [49//3, 0, 0, 1//3]]
rat_sols = Vector{QQFieldElem}[[1, 0, 0, 0], [1//3, 0, 0, 1//3]]

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

param = rational_parametrization(I)

Expand Down

0 comments on commit 9800eac

Please sign in to comment.