This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r""" | |
Link class | |
""" | |
#***************************************************************************** | |
# Copyright (C) 2014 | |
# | |
# Distributed under the terms of the GNU General Public License (GPL) | |
# http://www.gnu.org/licenses/ | |
#***************************************************************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r""" | |
Link class | |
""" | |
#***************************************************************************** | |
# Copyright (C) 2014 | |
# | |
# Distributed under the terms of the GNU General Public License (GPL) | |
# http://www.gnu.org/licenses/ | |
#***************************************************************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dt = self._dt_code | |
gauss = [] | |
y = [None for i in range(2*len(dt))] | |
x = [0 for i in range(2*len(dt))] | |
for i in range(len(dt)): | |
x[2*i] = 2*i + 1 | |
x[2*i + 1] = dt[i] | |
for i in range(len(dt)): | |
if x[2*i+1] > 0: | |
y[2*i+1] = 'under' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gauss_code(self): | |
r""" | |
Returns the gauss_code | |
INPUT: | |
- Either a braidword, gauss_code, dt_code | |
OUTPUT: | |
- Gauss code representation of the INPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dt_code(self): | |
r""" | |
Returns the dt_code | |
INPUT: | |
- Either a braidword, gauss_code, dt_code | |
OUTPUT: | |
- DT Code representation of the INPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def PD_code(self): | |
'''dt = self.dt_code() | |
y = [None for i in range(2*len(dt))] | |
x = [0 for i in range(2*len(dt))] | |
for i in range(len(dt)): | |
x[2*i] = 2*i + 1 | |
x[2*i + 1] = dt[i] | |
#print x | |
p = [[None,None] for i in range(len(x))] | |
t = [abs(r) for r in x] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
l1 = list(left_component) | |
print l1 | |
for i in l1: | |
if i[0] < 0: | |
i[0] = abs(i[0]) | |
elif i[1] < 0: | |
i[1] = abs(i[1]) | |
print l1 | |
print id(l1) | |
print left_component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r""" | |
Link class | |
""" | |
#***************************************************************************** | |
# Copyright (C) 2014 | |
# | |
# Distributed under the terms of the GNU General Public License (GPL) | |
# http://www.gnu.org/licenses/ | |
#***************************************************************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def seifert_circles(self, oriented_gauss_code): | |
self.oriented_gauss_code = oriented_gauss_code | |
x = self.PD_code_ogc(self.oriented_gauss_code) | |
s = [[None for i in range(4)] for i in range(len(x))] | |
for i in range(len(x)): | |
s[i][0] = 'entering' | |
s[i][2] = 'leaving' | |
if self.oriented_gauss_code[1][i] == '-': | |
s[i][1] = 'leaving' | |
s[i][3] = 'entering' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#whatever is the crossing one should give the sign for that first | |
#the order of the sign is as per the ordering of the crossings as in the gauss code | |
#so for example if the gauss code is 1 -3 2 -1 3 -2 then the order of the sign of the crossings is | |
#sign of crossing 1 then 3 then at 2 and so on and so forth. | |
def PD_code_ogc(self, oriented_gauss_code): | |
self.oriented_gauss_code = oriented_gauss_code | |
gc = self.oriented_gauss_code[0] | |
gc_sign = self.oriented_gauss_code[1] | |
l = [0 for i in range(len(gc))] | |
for i in range(len(gc)): |