add more debug, SLE solver not working?
This commit is contained in:
parent
a36e4f6d08
commit
9c2bb94603
10
Sketch.py
10
Sketch.py
@ -32,13 +32,18 @@ class Sketch(object):
|
||||
dim = max(len(equations), len(shape_vars))
|
||||
C = zeros((dim, dim))
|
||||
d = zeros(dim)
|
||||
print 'matrix size (%d, %d)' % (dim, dim)
|
||||
for i in range(len(equations)):
|
||||
e = equations[i]
|
||||
coeffs = e[0]
|
||||
for c in coeffs:
|
||||
var_index = shape_vars[c[1]]
|
||||
C[i][var_index] = c[0]
|
||||
if c[0] != 0:
|
||||
print c[1][0].name, c[1][1], 'is at', i, var_index, \
|
||||
'with coefficient', c[0]
|
||||
d[i] = e[1]
|
||||
print 'equ', i, 'expected value:', e[1]
|
||||
# for row in range(len(equations)):
|
||||
# print '[',
|
||||
# for col in range(len(shape_vars)):
|
||||
@ -48,9 +53,10 @@ class Sketch(object):
|
||||
s = SLE(C, d)
|
||||
r = s.solve()
|
||||
solved_vars = r.xf
|
||||
print 'IGNORED THINGY: ', r.ff
|
||||
print "SOLVED: ", solved_vars
|
||||
for i in range(len(solved_vars)):
|
||||
varid_to_shape_var[i][0].setVar(varid_to_shape_var[i][1],
|
||||
solved_vars[i])
|
||||
# for s in self.shapes:
|
||||
# print 'shape:', repr(s.vars)
|
||||
for s in self.shapes:
|
||||
print 'shape:', repr(s.vars)
|
||||
|
Loading…
x
Reference in New Issue
Block a user