Hi Tim,
many thanks for the tipps, i used the same way
with vectorized (chunk) method on the indexing operation.
..
..
# out = zeros((size_mcf[0],sizes_smatrix[2]+5),Float32)
# size_mcf[0] ~ 24
eig = zeros((size_mcf[0],3,3),dtype=Float32)
eigwert = zeros((size_mcf[0],3),dtype=Float64)
#
# here is speed up ~30
#for j in arange(0,size_mcf[0]):
#eig[0,0] = out[j,1]
#eig[1,1] = out[j,2]
#eig[2,2] = out[j,3]
#
#eig[0,1] = out[j,4]
#eig[0,2] = out[j,6]
#eig[1,0] = out[j,4]
#eig[1,2] = out[j,5]
#eig[2,0] = out[j,6]
#eig[2,1] = out[j,5]
#
eig[:,0,0] = out[:,1]
eig[:,1,1] = out[:,2]
eig[:,2,2] = out[:,3]
eig[:,1,0] = eig[:,0,1] = out[:,4]
eig[:,2,0] = eig[:,0,2] = out[:,6]
eig[:,2,1] = eig[:,1,2] = out[:,5]
#
for i in arange(size_mcf[0]):
eigwert[i] = eigvals(eig[i,:,:])
#
out[:,7:10] = sort(eigwert[:,:].astype(float32))
out[:,10] = abs(out[:,7]-out[:,9])
speedup factor ~30 !
f.
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion