Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/libs/mwrank/wrap.h
4069 views
1
#ifdef __cplusplus
2
/* The order here is very important. */
3
#include "eclib/curve.h"
4
#include "eclib/egr.h"
5
#include "eclib/descent.h"
6
#include "eclib/points.h"
7
#include "eclib/isogs.h"
8
#include "eclib/marith.h"
9
#endif
10
11
#ifdef __cplusplus
12
#define EXTERN extern "C"
13
#else
14
#define EXTERN
15
#endif
16
17
/**************** Miscellaneous functions ****************/
18
19
EXTERN long mwrank_get_precision();
20
EXTERN void mwrank_set_precision(long n);
21
22
EXTERN void mwrank_initprimes(char *pfilename, int verb);
23
24
/**************** bigint ****************/
25
#ifndef __cplusplus
26
struct bigint;
27
#endif
28
29
#ifdef __cplusplus
30
extern "C"
31
#endif
32
struct bigint* new_bigint(void);
33
34
EXTERN void del_bigint(struct bigint* x);
35
36
EXTERN struct bigint* str_to_bigint(char* s);
37
38
39
EXTERN char* bigint_to_str(struct bigint* x);
40
41
42
/**************** Curvedata ****************/
43
44
#ifndef __cplusplus
45
struct Curvedata;
46
#endif
47
48
EXTERN struct Curvedata* Curvedata_new(const struct bigint* a1, const struct bigint* a2,
49
const struct bigint* a3, const struct bigint* a4,
50
const struct bigint* a6, int min_on_init);
51
52
EXTERN void Curvedata_del(struct Curvedata* curve);
53
54
55
EXTERN char* Curvedata_repr(struct Curvedata* curve);
56
57
EXTERN double Curvedata_silverman_bound(const struct Curvedata* curve);
58
59
EXTERN double Curvedata_cps_bound(const struct Curvedata* curve);
60
61
EXTERN double Curvedata_height_constant(const struct Curvedata* curve);
62
63
EXTERN char* Curvedata_getdiscr(struct Curvedata* curve);
64
65
EXTERN char* Curvedata_conductor(struct Curvedata* curve);
66
67
EXTERN char* Curvedata_isogeny_class(struct Curvedata* E, int verbose);
68
69
/**************** mw -- subgroup of the mordell-weil group ****************/
70
#ifndef __cplusplus
71
struct mw;
72
#endif
73
74
EXTERN struct mw* mw_new(struct Curvedata* curve, int verb, int pp, int maxr);
75
76
EXTERN void mw_del(struct mw* m);
77
78
EXTERN int mw_process(struct Curvedata* curve, struct mw* m,
79
const struct bigint* x, const struct bigint* y,
80
const struct bigint* z, int sat);
81
82
EXTERN char* mw_getbasis(struct mw* m);
83
84
EXTERN char* mw_regulator(struct mw* m);
85
86
EXTERN int mw_rank(struct mw* m);
87
88
/* Returns index and unsat long array, which user must deallocate */
89
EXTERN int mw_saturate(struct mw* m, struct bigint* index, char** unsat,
90
long sat_bd, int odd_primes_only);
91
92
EXTERN void mw_search(struct mw* m, char* h_lim, int moduli_option, int verb);
93
94
95
96
/**************** two_descent ****************/
97
#ifndef __cplusplus
98
struct two_descent;
99
#endif
100
101
EXTERN struct two_descent* two_descent_new(struct Curvedata* curve, \
102
int verb, int sel,
103
long firstlim, long secondlim,
104
long n_aux, int second_descent);
105
106
EXTERN void two_descent_del(struct two_descent* t);
107
108
EXTERN long two_descent_get_rank(struct two_descent* t);
109
110
EXTERN long two_descent_get_rank_bound(struct two_descent* t);
111
112
EXTERN long two_descent_get_selmer_rank(struct two_descent* t);
113
114
EXTERN char* two_descent_get_basis(struct two_descent* t);
115
116
EXTERN int two_descent_ok(const struct two_descent* t);
117
118
EXTERN long two_descent_get_certain(const struct two_descent* t);
119
120
EXTERN void two_descent_saturate(struct two_descent* t, long sat_bd); // = -1 for default set in eclib/src/qcurves/saturate.h (currently 100)
121
122
EXTERN char* two_descent_regulator(struct two_descent* t);
123
124
125