view tests/testLstsq.py @ 64:a115c982a0fd

Fixed bug in GAP: Lambdahat might get empty after row removing; in this case should stop and return current solution, otherwise it will raise an exception next time you try to remove rows
author Nic Cleju <nikcleju@gmail.com>
date Tue, 13 Mar 2012 16:18:11 +0200
parents 9079a9f7c4cf
children
line wrap: on
line source
import numpy as np
import numpy.linalg
import scipy.io
import scipy.linalg
import time

def main():
	mdict = scipy.io.loadmat('testLstsq.mat')
	A = mdict['A'].newbyteorder('=')
	b = mdict['b']
	
	starttime = time.time()
	for i in np.arange(mdict['nruns']):
	#for i in np.arange(100):
		#np.linalg.lstsq(A, b)
		np.linalg.svd(A)
	print "Elapsed time = ",(time.time() - starttime)

if __name__ == "__main__":
	main()