Hi Julien,
I use the C-interface of Lapack (LAPACKE) and it seems that DTRTTP is not working correctly (or I make a mistake in using it).
I have stored my symmetric matrix in full row-wise format (since it is symmetric row- or column-wise doesn't really matter).
When I use DTRTTP I do not get the correct matrix stored in packed format. The formula I use is:
info=LAPACKE_dtrttp(LAPACK_ROW_MAJOR,'L',n,fullA,n,symmA);
where fullA is the n x n matrix stored in full format, and symmA should be the lower triangular part of fullA stored in packed row-wise format.
So the third element of symmA should be the second diagonal element of fullA (fullA(2,2)). In stead it returns the element on position (1,4). This is even not the correct value if it was stored column wise.
However when using LAPACK_COL_MAJOR, symmA is entirely correct.
Perhaps this is also the cause of the incorrect functioning of dpptrf.
I tracked it down a bit further and according to me there's an error in the function dtp_trans.
- Code: Select all
if( ( colmaj || upper ) && !( colmaj && upper ) ) {
for( j = st; j < n; j++ ) {
for( i = 0; i < j+1-st; i++ ) {
out[ j-i + (i*(2*n-i+1))/2 ] = in[ ((j+1)*j)/2 + i ];
}
}
} else {
for( j = 0; j < n-st; j++ ) {
for( i = j+st; i < n; i++ ) {
out[ j + ((i+1)*i)/2 ] = in[ (j*(2*n-j+1))/2 + i-j ];
}
}
}
When converting a column-major lower packed matrix, the second formula should be used (and not the first one), the same accounts for row-major upper packed matrix. It thus seems the formulas in the if-statement should be switched.
best regards,
Arne