Mercurial > hg > pycsalgos
comparison tests/testLstsq.py @ 7:9079a9f7c4cf
More tests
author | nikcleju |
---|---|
date | Sat, 05 Nov 2011 11:41:38 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
6:cc7239d5e972 | 7:9079a9f7c4cf |
---|---|
1 import numpy as np | |
2 import numpy.linalg | |
3 import scipy.io | |
4 import scipy.linalg | |
5 import time | |
6 | |
7 def main(): | |
8 mdict = scipy.io.loadmat('testLstsq.mat') | |
9 A = mdict['A'].newbyteorder('=') | |
10 b = mdict['b'] | |
11 | |
12 starttime = time.time() | |
13 for i in np.arange(mdict['nruns']): | |
14 #for i in np.arange(100): | |
15 #np.linalg.lstsq(A, b) | |
16 np.linalg.svd(A) | |
17 print "Elapsed time = ",(time.time() - starttime) | |
18 | |
19 if __name__ == "__main__": | |
20 main() |