j
k
j a
j l
On 2/3/2012 3:37 PM, josef.pktd@gmail.com wrote:
res = - np.dot(x.T, mass*x) res[np.arange(3), np.arange(3)] -= np.trace(res)
Nice! Get some speed gain with slicing: res = - np.dot(x.T, mass*x) res.flat[slice(0,None,4)] -= np.trace(res) Alan
Back to the thread
Back to the list