You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment I try to refactor a code which consists of a loop of dlarfx calls to a single dlarft/dlarfb call to improve performance. The code transform a matrix A which is part of a product P * A * Q^T and the dlarft/dlarfb calls intend to modify the P and Q matrix so that the product is still valid.
My problem is that the refactored code results into completely different matrices. My questions is if there are known subtle differences or caveats of the dlarft/dlarfb code in comparison to a loop of dlarfx applications? Or do I have a misunderstand of the dlarft/dlarfb interface from the documentation and call the functions the wrong way.
Below I attach the relevant except of both versions of the code. It is assumed that the input matrix A is square with dimension (N, N). The code is written in C and uses the LAPACKE interface. Since the matrix is processed in backwards order, the Householder vector is of from (v, v, 1, 0).
Loop version
for (inti=N-1; i >= 0; i--) {
// Calculation of Householder vector and tau, omittedLAPACKE_dlarfx_work(LAPACK_COL_MAJOR,
'R',
nrowsq, // Number of rows of QN,
vec_array,// Householder vectortau,
q, // Stored as Q => application from rightldq,
work);
}
LAPACKE_dlarft_work(LAPACK_COL_MAJOR,
'B',
'R',
N,
N,
a,
lda,
tauq_array,
t_matrix,
N);
LAPACKE_dlarfb_work(LAPACK_COL_MAJOR,
'R',
'N',
'B',
'R',
nrowsq,
N,
N,
a,
lda,
t_matrix,
N,
q,
ldq,
work,
nrowsq);
For any hint why the blocked version results into different results I would be very thankful. If you need another information to triangulate the error, I am happy to provide more info.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
At the moment I try to refactor a code which consists of a loop of dlarfx calls to a single dlarft/dlarfb call to improve performance. The code transform a matrix A which is part of a product P * A * Q^T and the dlarft/dlarfb calls intend to modify the P and Q matrix so that the product is still valid.
My problem is that the refactored code results into completely different matrices. My questions is if there are known subtle differences or caveats of the dlarft/dlarfb code in comparison to a loop of dlarfx applications? Or do I have a misunderstand of the dlarft/dlarfb interface from the documentation and call the functions the wrong way.
Below I attach the relevant except of both versions of the code. It is assumed that the input matrix A is square with dimension (N, N). The code is written in C and uses the LAPACKE interface. Since the matrix is processed in backwards order, the Householder vector is of from (v, v, 1, 0).
Loop version
Blocked version
a is constructed as matrix with elements
where
vqX
are the vectors for application to Q.For any hint why the blocked version results into different results I would be very thankful. If you need another information to triangulate the error, I am happy to provide more info.
Beta Was this translation helpful? Give feedback.
All reactions