-
Notifications
You must be signed in to change notification settings - Fork 145
/
Copy pathclass_poly.c
55 lines (42 loc) · 1.01 KB
/
class_poly.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* This file is public domain. Author: Fredrik Johansson. */
#include <string.h>
#include "arb.h"
#include "acb_modular.h"
#include "flint/profiler.h"
int main(int argc, char *argv[])
{
fmpz_poly_t res;
slong i, num_threads;
slong D;
if (argc < 2)
{
flint_printf("usage: build/examples/class_poly D [-threads n]\n");
return 1;
}
D = atol(argv[1]);
num_threads = 1;
for (i = 2; i < argc; i++)
{
if (!strcmp(argv[i], "-threads"))
num_threads = atol(argv[i+1]);
}
flint_set_num_threads(num_threads);
fmpz_poly_init(res);
TIMEIT_ONCE_START
acb_modular_hilbert_class_poly(res, D);
TIMEIT_ONCE_STOP
SHOW_MEMORY_USAGE
if (FLINT_ABS(D) <= 100)
{
fmpz_poly_print(res);
flint_printf("\n");
}
else
{
flint_printf("degree = %wd, bits = %wd\n",
fmpz_poly_degree(res), fmpz_poly_max_bits(res));
}
fmpz_poly_clear(res);
flint_cleanup_master();
return 0;
}