From 47aa10e53fd3f4416783eb5f19259f22811a07ed Mon Sep 17 00:00:00 2001 From: Remi Prebet Date: Tue, 9 Jul 2024 22:52:28 -0700 Subject: [PATCH 1/2] Fix bug in _get_rational_parametrization: division by a number instead of multiplication --- src/algorithms/solvers.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/solvers.jl b/src/algorithms/solvers.jl index 83704da..56c5087 100644 --- a/src/algorithms/solvers.jl +++ b/src/algorithms/solvers.jl @@ -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 From 407616cefdd49244fade2a0a4b553de9426bf69e Mon Sep 17 00:00:00 2001 From: Remi Prebet Date: Tue, 9 Jul 2024 23:45:52 -0700 Subject: [PATCH 2/2] fix tests formely adapted to the bugged rational parametrization function --- test/algorithms/solvers.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/algorithms/solvers.jl b/test/algorithms/solvers.jl index 0cda5fc..eeb3546 100644 --- a/test/algorithms/solvers.jl +++ b/test/algorithms/solvers.jl @@ -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) @@ -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)