summaryrefslogtreecommitdiff
path: root/src/math
diff options
context:
space:
mode:
authorJ08nY2017-04-10 00:39:07 +0200
committerJ08nY2017-04-10 00:39:07 +0200
commit08bff37e281d9ae1911611693e5cff71b50f8578 (patch)
tree4b1a9aa9059c22629d07ffeb7b2c7b51fa2289fb /src/math
parent3598e2d17837e480869e472e224140ad2643c58c (diff)
downloadecgen-08bff37e281d9ae1911611693e5cff71b50f8578.tar.gz
ecgen-08bff37e281d9ae1911611693e5cff71b50f8578.tar.zst
ecgen-08bff37e281d9ae1911611693e5cff71b50f8578.zip
Fixed exhaustive curve generation for params with no curve
- Added some debug prints - Fixed debug macro - Temporarily disabled obj_free in exhaustive_gen until roll_t arrives
Diffstat (limited to 'src/math')
-rw-r--r--src/math/curve.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/math/curve.c b/src/math/curve.c
index 0d4cd12..ba21280 100644
--- a/src/math/curve.c
+++ b/src/math/curve.c
@@ -114,14 +114,23 @@ int curve_any(curve_t *curve, const config_t *cfg, arg_t *args) {
default:
pari_err_TYPE("curve_any", curve->field);
}
+ GEN crv = ellinit(v, curve->field, -1);
- curve->curve = gerepilecopy(ltop, ellinit(v, curve->field, -1));
- return 1;
+ if (glength(crv) == 0) {
+ avma = ltop;
+ return -3;
+ } else {
+ curve->curve = gerepilecopy(ltop, crv);
+ return 1;
+ }
}
int curve_nonzero(curve_t *curve, const config_t *cfg, arg_t *args) {
pari_sp ltop = avma;
- curve_any(curve, cfg, args);
+ int any = curve_any(curve, cfg, args);
+ if (any <= 0) {
+ return any;
+ }
if (gequal0(ell_get_disc(curve->curve))) {
avma = ltop;
return -3;