I'd like to calculate the following one-dimensional array:
OneDimArray = Table[(Norm[Sum[ MatrixA[[i,j]]VectorB[[j]],{j,N}]])^2,{i,N}]
However this takes a very long time when N
goes up; for N = 1500
it already takes ~40 minutes (on my MacBook Pro).
I've heard there are certain functions in Mathematica that are optimized for speed; could I employ those (and if so: which ones?) to speed up this calculation?
Thanks a lot in advance for any help!
Steven
Abs[Dot[MatrixA, VectorB]]^2
. By the way, don't use capitalized words for user-defined symbols so as not to conflict with Mathematica's built-in functions, which all start with capital letters. $\endgroup$