Skip to content

Commit

Permalink
more of the same, WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnCremona committed Mar 6, 2024
1 parent 4c404b8 commit 2cd8bf3
Show file tree
Hide file tree
Showing 4 changed files with 227 additions and 287 deletions.
37 changes: 17 additions & 20 deletions libsrc/eclib/mrank1.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
//////////////////////////////////////////////////////////////////////////
//
// Copyright 1990-2023 John Cremona
//
//
// This file is part of the eclib package.
//
//
// eclib is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2 of the License, or (at your
// option) any later version.
//
//
// eclib is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with eclib; if not, write to the Free Software Foundation,
// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
//
//
//////////////////////////////////////////////////////////////////////////

#if !defined(_ECLIB_MRANK1_H)
Expand All @@ -28,20 +28,20 @@
#include <eclib/mquartic.h>

class rank1 : public rank12 {
private:
private:
long nquarticsa, nquarticsb, nfirstlota, nfirstlotb;
long sha_rank, sha2;
int traceequiv, posdisc, disc_is_square, npairs, extra2, threediv, type;
quartic *qlista, *qlistb;
vector<int> qlistbflag;
vector<bigcomplex> croots, cphi;
vector<Point> pointlist1, pointlist2;
long npoints1, npoints2;
long npoints1, npoints2;
int have_eggpoint, have_large_quartics;
long twoadic_index, global_index;
long twoadic_index, global_index;
long bsd_npairs; // only for testing
// 1, 2 or 4: local/global index of "small" quartics
bigint c4, c6, d1728, ii, jj, disc;
bigint c4, c6, d1728, ii, jj, disc;
long Imod2, Jmod2;
bigfloat xii, xjj;
vector<bigint> plist, dlist;
Expand All @@ -54,38 +54,35 @@ class rank1 : public rank12 {
vector<long> auxs, amod, astepmod, hmod, hstepmod, hscalemod;
vector<vector<long>> phimod;
vector<int> aux_flags, aux_types;

int **squares;
int ***flags;
int **flaga;
vector<vector<int>> squares, flaga;
vector<vector<vector<int>>> flags;
long ah_count, ah_sieve_0, ah_sieve_1, ah_sieve_2;
long ah_rfail, ah_dfail, ah_efail, ah_extra2fail, ah_pass;

void aux_init(); // define auxiliary moduli and squares
void flag_init(); // set up flag array
void clear_sieve(); // free memory related to sieve;
vector<long> qeps(const quartic&, int x2); //computes eps of quartic
void show_eps_vec(const vector<long>& vec);

// process latest quartic found
void addquartic(const bigint& a, const bigint& b, const bigint& c,
const bigint& d, const bigint& e);
void addquartic(const bigint& a, const bigint& b, const bigint& c,
const bigint& d, const bigint& e);
void getquartics();
void getquartics1();
void gettype(int t);
public:
rank1(Curvedata* ec,
int verb=0, int sel=0,
rank1(Curvedata* ec,
int verb=0, int sel=0,
long lim1=20, long lim2=5, long n_aux=-1);
// lim1 is bound on |x|+|z| in naive search
// lim2 is bound on log max {|x|,|z| }, i.e. logarithmic
// sel is selmer_only switch
// n_aux is # sieving primes in quartic search
// n_aux=-1 causes default to be used (depends on method)
//
~rank1() {if (num_aux>0) {clear_sieve();}}
void sortpoints();
void listpoints();
void listpoints(Curvedata* CD_orig, const bigint& u, const bigint& r,
void listpoints(Curvedata* CD_orig, const bigint& u, const bigint& r,
const bigint& s, const bigint& t);
vector<Point> getgens() const;
vector<Point> getpoints();
Expand Down
14 changes: 6 additions & 8 deletions libsrc/eclib/sifter.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,18 @@ class sifter {
int verbose;

int num_aux, max_dim_im;
int ** eps_mat;
int * pivcols;
long * auxs; long * all_p; int * nroots;
vector<vector<long>> thetamod; int**squares;
vector<vector<int>> eps_mat, squares;
vector<int> pivcols, nroots;
vector<long> auxs, all_p;
vector<vector<long>> thetamod;
public:
sifter(Curvedata* EE, int na, int verb=0);
~sifter();
int code(const bigint& x, const bigint& z2, int i);
int * eps(const bigint& x, const bigint& z2);
vector<int> eps(const bigint& x, const bigint& z2);
void process(const Point& P);
void process(const vector<Point>& Plist);
int getrank() {return rank;}
void vecout(int* v);
void vecout(const vector<int>& v);
};


#endif
Loading

0 comments on commit 2cd8bf3

Please sign in to comment.