예제 #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)