rpmuller wrote:I'm interested in using the PDLASET routine to only zero the lower triangle of a matrix, and *not* the diagonal itself. Is there a routine (or a way to call PDLASET) that does this? I've been hunting through the ScaLAPACK source, but haven't had any luck.
A helpful user emailed the following to me. I'm posting it here in case anyone else runs into the same problem. It's a cute trick: the idea is to point to the first off diagonal element, and then zero M-1 elements instead of M.
CALL PDLASET( 'Lower triangular', M-1, M-1, ZERO, ZERO, A, IA+1, JA, DESCA )
This call will make A in upper Hessenberg form (given that the upper triangular part, including the diagonal, contains something nonzero).
I've tested this out in my own code and can confirm that it works. For the Upper triangle you call:
CALL PDLASET( 'Upper triangular', M-1, M-1, ZERO, ZERO, A, IA, JA+1, DESCA )