Example #1
0
def demo(dname, Ncheb = 1000, Nbin = 50):
	
	## Calling loadgraph and set timer 1
	with MyTimer('Timer One'):
		A, mylambda = load_graph(dname)
		N = nadjacency(A)

	## Calculate cheb moments and set timer 2
	with MyTimer('Timer Two'):
		c = moments_cheb(N, Ncheb, 10)

	## Compare the resuts and display plot, notice filtered cheb moments are passed 
	compare_chebhist(dname, mylambda, filter_jackson(c), Nbin)
Example #2
0
def generateCheb(dname, Ncheb = 1000, Nbin = 50):
	
	## Calling loadgraph and set timer 1
	with MyTimer('Timer One'):
		A, mylambda = load_graph(dname)
		N = nadjacency(A)

		c = moments_cheb(N, Ncheb, 10)
		cheb_file_content = '\n'.join([str(st) for st in c])

		cheb_filename = 'data/' + dname + '.cheb'
		f = open(cheb_filename, 'w+')
		f.write(cheb_file_content)
		f.close()