-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathknotkit.h
More file actions
125 lines (98 loc) · 2.66 KB
/
knotkit.h
File metadata and controls
125 lines (98 loc) · 2.66 KB
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
122
123
124
125
// includes lib.h
#include <algebra/algebra.h>
extern bool verbose;
static const unsigned max_edges = 58;
static const unsigned max_crossings = 29;
static const unsigned max_circles = 58;
class knot_diagram;
#include <planar_diagram.h>
#include <dt_code.h>
#include <knot_diagram.h>
#include <simplify_chain_complex.h>
#include <sseq.h>
#include <smoothing.h>
#include <cobordism.h>
#include <cube.h>
#include <steenrod_square.h>
#include <spanning_tree_complex.h>
class knot_desc
{
public:
enum table
{
NONE,
ROLFSEN,
HTW,
HTW_ALT,
HTW_NONALT,
MT,
MT_ALT,
MT_NONALT,
TORUS,
};
table t;
unsigned i;
unsigned j;
public:
knot_desc () : t(NONE) { }
knot_desc (table t_, unsigned i_, unsigned j_)
: t(t_), i(i_), j(j_)
{ }
knot_desc (const knot_desc &desc)
: t(desc.t), i(desc.i), j(desc.j)
{ }
knot_desc (reader &r);
~knot_desc () { }
knot_desc &operator = (const knot_desc &desc)
{
t = desc.t;
i = desc.i;
j = desc.j;
return *this;
}
bool operator == (const knot_desc &desc) const
{
return t == desc.t && i == desc.i && j == desc.j;
}
bool operator < (const knot_desc &desc) const
{
if ((int)t < (int)desc.t)
return 1;
else if ((int)t > (int)desc.t)
return 0;
if (i < desc.i)
return 1;
else if (i > desc.i)
return 0;
return j < desc.j;
}
knot_diagram diagram () const;
std::string name () const;
unsigned table_crossing_knots () const;
hash_t hash_self () const
{
return hash_combine (hash ((int)t),
hash_combine (hash (i),
hash (j)));
}
void write_self (writer &w) const;
void show_self () const { printf ("%s", name ().c_str ()); }
void display_self () const { show_self (); newline (); }
};
unsigned rolfsen_crossing_knots (unsigned n);
planar_diagram rolfsen_knot (unsigned n, unsigned k);
unsigned htw_knots (unsigned n, bool alternating);
unsigned htw_knots (unsigned n);
dt_code htw_knot (unsigned n, bool alternating, unsigned k);
dt_code htw_knot (unsigned n, unsigned k);
unsigned mt_links (unsigned n, bool alternating);
unsigned mt_links (unsigned n);
dt_code mt_link (unsigned n, bool alternating, unsigned k);
dt_code mt_link (unsigned n, unsigned k);
planar_diagram torus_knot (unsigned n_strands, unsigned n_shifts);
knot_diagram braid (unsigned n_strands, const basedvector<int, 1> &twists);
knot_diagram braid (unsigned n_strands, unsigned n_twists, int twists_ar[]);
knot_diagram parse_knot (const char *s);
resolution_diagram parse_resolution_diagram (const char *s);
// 11 <= n <= 15
basedvector<basedvector<unsigned, 1>, 1> mutant_knot_groups (unsigned n);