-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcoulfact.h
More file actions
40 lines (37 loc) · 948 Bytes
/
coulfact.h
File metadata and controls
40 lines (37 loc) · 948 Bytes
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
#ifndef COULFACT_H
#define COULFACT_H 1
#include "types.h"
#include <gmp.h>
typedef struct s_ppow {
ulong p;
uint e;
} t_ppow;
typedef struct s_fact {
uint count;
uint size;
t_ppow *ppow;
} t_fact;
typedef struct s_zpow {
mpz_t p;
uint e;
} t_zpow;
typedef struct s_zfact {
uint count;
uint size;
t_zpow *ppow;
} t_zfact;
extern void init_fact(t_fact *f);
extern void free_fact(t_fact *f);
extern void add_fact(t_fact *f, t_ppow pp);
extern void reverse_fact(t_fact *f);
extern void init_zfact(t_zfact *f);
extern void free_zfact(t_zfact *f);
extern void add_zfact(t_zfact *f, t_zpow pp);
extern void simple_fact(uint n, t_fact *f);
extern uint simple_tau(t_fact *f);
extern uint simple_valuation(ulong n, ulong p);
extern uint simple_prime_count(ulong n);
extern uint tiny_gcd(uint a, uint b);
extern ulong simple_gcd(ulong a, ulong b);
extern int _mpz_comparator(const void *va, const void *vb);
#endif