Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amitjamadagni/c7d5832e47e1d04988b5 to your computer and use it in GitHub Desktop.
Save amitjamadagni/c7d5832e47e1d04988b5 to your computer and use it in GitHub Desktop.
DT code to gauss
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'
y[2*i] = 'over'
elif x[2*i+1] < 0:
y[2*i+1] = 'over'
y[2*i] = 'under'
for i in range(1,len(x)+1):
for j in range(0,len(x)):
if abs(x[j]) == i:
if y[j] == 'under':
gauss.append(-(j//2 + 1))
elif y[j] == 'over':
gauss.append(j//2 + 1)
return gauss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment