[SciPy-user] lower triangle matrix part: indexes of non-zeros

dmitrey dmitrey.kroshko@scipy....
Sat Oct 20 07:55:10 CDT 2007


Hi all,
I have a square symmetric matrix H (Hesse matrix).
I need to obtain 3 vectors ind_0, ind_1, vals:
vals[k] = H[ind_0[k], ind_1[k]]
All those ind_0, ind_1, vals must be related to lower triangle part of H 
only.
What's the best way to solve the problem?
I'm usind H.nonzero() but it yields whole H, while I need only lower 
triangle.

Regards, D.


More information about the SciPy-user mailing list