示例#1
0
文件: layouts.py 项目: xqx12/grandalf
 def _xyinit(self,y=None):
     if y is None: y = rand_ortho1(self.g.order())
     x = rand_ortho1(self.g.order())
     # translate and normalize:
     x = x-x[0]
     y = y-y[0]
     sfactor = 1.0/max(y.max(),x.max())
     return matrix(zip(x*sfactor,y*sfactor))
示例#2
0
文件: layouts.py 项目: xqx12/grandalf
 def optimal_arrangement(self):
     b = self.balance()
     y = rand_ortho1(self.g.order())
     return self._conjugate_gradient_L(y,b)