-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcube.h
121 lines (90 loc) · 3.02 KB
/
cube.h
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
class map_rules
{
public:
map_rules () { }
map_rules (const map_rules &) = delete;
virtual ~map_rules () { }
map_rules &operator = (const map_rules &) = delete;
virtual void map (basedvector<pair<unsigned, unsigned>, 1> &out,
resolution_diagram_builder &rdb) const = 0;
};
template<class R>
class cube /* of resolutions */
{
public:
typedef ::linear_combination<R> linear_combination;
typedef ::linear_combination_const_iter<R> linear_combination_const_iter;
public:
bool markedp_only;
knot_diagram &kd;
unsigned n_crossings;
unsigned n_resolutions;
unsigned n_generators;
vector<unsigned> resolution_circles;
vector<unsigned> resolution_generator1;
ptr<const module<R> > khC;
mod_map<R> compute_map (unsigned dh, unsigned max_n,
bool mirror,
bool reverse_orientation,
unsigned to_reverse,
const map_rules &rules) const;
mod_map<R> compute_d (unsigned dh, unsigned max_n,
bool mirror,
bool reverse_orientation,
unsigned to_reverse) const;
mod_map<R> compute_twin_arrows_P (bool mirror,
bool reverse_orientation,
unsigned to_reverse) const;
mod_map<R> compute_dinv (unsigned c);
mod_map<R> H_i (unsigned c);
mod_map<R> compute_nu () const;
mod_map<R> compute_X (unsigned p) const;
void check_reverse_crossings ();
void check_reverse_orientation ();
public:
cube (knot_diagram &d_, bool markedp_only_ = 0);
~cube () { }
grading compute_generator_grading (unsigned g) const;
grading compute_state_monomial_grading (unsigned state, unsigned monomial) const;
unsigned generator (unsigned i, unsigned j) const;
pair<unsigned, unsigned> generator_state_monomial (unsigned g) const;
ptr<const module<R> > compute_kh () const;
void show_state (unsigned state) const;
void show_state_monomial (unsigned state, unsigned monomial) const;
void show_self () const { printf ("cube"); }
void display_self () const;
};
class twisted_map_rules
{
public:
twisted_map_rules () { }
twisted_map_rules (const twisted_map_rules &) = delete;
virtual ~twisted_map_rules () { }
map_rules &operator = (const twisted_map_rules &) = delete;
virtual void map (basedvector<triple<unsigned, unsigned, set<unsigned> >, 1> &out,
resolution_diagram_builder &rdb) const = 0;
};
template<class F>
class twisted_cube
{
public:
typedef fraction_field<polynomial<F> > R;
public:
const cube<R> &c;
public:
twisted_cube (const cube<R> &c_)
: c(c_)
{ }
twisted_cube (const twisted_cube &) = delete;
~twisted_cube () { }
twisted_cube &operator = (const twisted_cube &) = delete;
mod_map<R> compute_twisted_map (basedvector<int, 1> edge_weight,
unsigned dh,
unsigned to_reverse,
const twisted_map_rules &rules) const;
mod_map<R> compute_twisted_barE (basedvector<int, 1> edge_weight,
unsigned dh, unsigned to_reverse) const;
mod_map<R> twisted_d0 (basedvector<int, 1> edge_weight) const;
};
extern sseq compute_szabo_sseq (const cube<Z2> &c);
#include <cube_impl.h>