Hi users,

      i have some problem in Numpy with indexing speed for array to tensor
matrix transport.
With 200000 cycles it's 9sec ! (without sort(eigvals() - functions)

Many thanks
f.


# stress values/matrix in array form for 200000 points
out = zeros((200000,11),Float32)
#
#.....out = filling matrix ...etc...
#
# stress tensor matrix
eig = zeros((3,3),Float32)
#
#output for eigvalues
eigwert = array([0,0,0])
#
for j in arange(0,200000):
      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]
      #
      eigwert = sort(eigvals(eig))
      out[j,7] = eigwert[2]
      out[j,8] = eigwert[1]
      out[j,9] = eigwert[0]
      out[j,10] = abs(eigwert[0]-eigwert[2])
#


-------------------------------------------------------------------------
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.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to