Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Testing latest pari + WASM + node.js... and it works?! Wow.

28485 views
License: GPL3
ubuntu2004
1
/* Copyright (C) 2000 The PARI group.
2
3
This file is part of the PARI/GP package.
4
5
PARI/GP is free software; you can redistribute it and/or modify it under the
6
terms of the GNU General Public License as published by the Free Software
7
Foundation; either version 2 of the License, or (at your option) any later
8
version. It is distributed in the hope that it will be useful, but WITHOUT
9
ANY WARRANTY WHATSOEVER.
10
11
Check the License for details. You should have received a copy of it, along
12
with the package; see the file 'COPYING'. If not, write to the Free Software
13
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
14
15
/* output of get_nf and get_bnf */
16
enum {
17
typ_NULL = 0,
18
typ_POL,
19
typ_Q,
20
typ_QFB,
21
typ_NF,
22
typ_BNF,
23
typ_BNR,
24
typ_ELL, /* elliptic curve */
25
typ_QUA, /* quadclassunit */
26
typ_GAL, /* galoisinit */
27
typ_BID,
28
typ_BIDZ,
29
typ_PRID,
30
typ_MODPR,
31
typ_RNF
32
};
33
34
/* types of algebras */
35
enum {
36
al_NULL = 0,
37
al_TABLE,
38
al_CSA,
39
al_CYCLIC
40
};
41
42
/* models for elements of algebras */
43
enum {
44
al_INVALID = 0,
45
al_TRIVIAL,
46
al_ALGEBRAIC,
47
al_BASIS,
48
al_MATRIX
49
};
50
51
/* idealtyp */
52
enum {
53
id_PRINCIPAL = 0,
54
id_PRIME,
55
id_MAT
56
};
57
58
typedef struct {
59
GEN T, dT; /* defining polynomial (monic ZX), disc(T) */
60
GEN T0; /* original defining polynomial (ZX) */
61
GEN unscale; /* T = C*T0(x / unscale), rational */
62
GEN dK; /* disc(K) */
63
GEN index; /* [O_K : Z[X]/(T)] */
64
GEN basis; /* Z-basis of O_K (t_VEC of t_POL) */
65
66
long r1; /* number of real places of K */
67
GEN basden; /* [nums(bas), dens(bas)] */
68
GEN dTP, dTE; /* (possibly partial) factorization of dT, primes / exponents */
69
GEN dKP, dKE; /* (possibly partial) factorization of dK, primes / exponents */
70
} nfmaxord_t;
71
72
/* qfr3 / qfr5 */
73
struct qfr_data { GEN D, sqrtD, isqrtD; };
74
75
/* various flags for nf/bnf routines */
76
enum {
77
nf_ORIG = 1,
78
nf_GEN = 1,
79
nf_ABSOLUTE = 2,
80
nf_FORCE = 2,
81
nf_ALL = 4,
82
nf_GENMAT = 4,
83
nf_INIT = 4,
84
nf_RAW = 8,
85
nf_RED = 8,
86
nf_PARTIALFACT = 16,
87
nf_ROUND2 = 64, /* obsolete */
88
nf_GEN_IF_PRINCIPAL = 512
89
};
90
91
enum {
92
rnf_REL = 1,
93
rnf_COND = 2
94
};
95
96
/* LLL */
97
enum {
98
LLL_KER = 1, /* only kernel */
99
LLL_IM = 2, /* only image */
100
LLL_ALL = 4, /* kernel & image */
101
LLL_GRAM = 0x100,
102
LLL_KEEP_FIRST = 0x200,
103
LLL_INPLACE = 0x400,
104
LLL_COMPATIBLE = 0x800 /* attempt same behavior on 32/64bit kernels */
105
};
106
107
/* HNF */
108
enum { hnf_MODID = 1, hnf_PART = 2, hnf_CENTER = 4 };
109
110
/* for fincke_pohst() */
111
typedef struct FP_chk_fun {
112
GEN (*f)(void *,GEN);
113
/* f_init allowed to permute the columns of u and r */
114
GEN (*f_init)(struct FP_chk_fun*,GEN,GEN);
115
GEN (*f_post)(struct FP_chk_fun*,GEN,GEN);
116
void *data;
117
long skipfirst;
118
} FP_chk_fun;
119
120
/* for ideallog / zlog */
121
typedef struct {
122
GEN bid;
123
GEN P, k;
124
GEN sprk; /* sprk[i] = sprkinit(P[i]^k[i])*/
125
GEN archp; /* archimedean part of conductor, in permutation form */
126
GEN mod;
127
GEN U; /* base change matrix blocks from (Z_K/P^k)^* and (Z/2)^#f_oo
128
* to bid.gen */
129
long hU; /* #bid.gen */
130
int no2; /* 1 iff fa2 = fa, i.e. no prime of norm 2 divide exactly bid.mod */
131
} zlog_S;
132
133