Skip to content

Instantly share code, notes, and snippets.

r"""
Link class
"""
#*****************************************************************************
# Copyright (C) 2014
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#*****************************************************************************
r"""
Link class
"""
#*****************************************************************************
# Copyright (C) 2014
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#*****************************************************************************
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'
def gauss_code(self):
r"""
Returns the gauss_code
INPUT:
- Either a braidword, gauss_code, dt_code
OUTPUT:
- Gauss code representation of the INPUT
def dt_code(self):
r"""
Returns the dt_code
INPUT:
- Either a braidword, gauss_code, dt_code
OUTPUT:
- DT Code representation of the INPUT
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]
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
r"""
Link class
"""
#*****************************************************************************
# Copyright (C) 2014
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#*****************************************************************************
@amitjamadagni
amitjamadagni / scandregions
Created June 21, 2014 21:17
Seifert circles and the regions of the knot
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'
@amitjamadagni
amitjamadagni / vogel
Created June 23, 2014 16:02
Vogel implementation along with PD Code
#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)):