def test_concatenate2(self,n=10,verbose=0): G1 = fg.WeightedGraph(n) G2 = fg.WeightedGraph(n) G1.complete() G2.complete() G = fg.concatenate_graphs(G1,G2) self.assert_(G.cc().max()==1)
def test_concatenate1(self,n=10,verbose=0): x1 = nr.randn(n,2) x2 = nr.randn(n,2) G1 = fg.WeightedGraph(x1.shape[0]) G2 = fg.WeightedGraph(x2.shape[0]) G1.knn(x1,5) G2.knn(x2,5) G = fg.concatenate_graphs(G1,G2) if verbose: G.plot(np.hstack((x1,x2))) self.assert_(G.cc().max()>0)