aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/QR/QR.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2008-05-12 10:23:09 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2008-05-12 10:23:09 +0000
commit45cda6704a067e73711f659ec6389fae7e36d1ad (patch)
treeb9bab79241fb673d41d8f47853b99b2cfe976c1c /Eigen/src/QR/QR.h
parentdca416cace14abdba682d82a212b215e05d1e17a (diff)
* Draft of a eigenvalues solver
(does not support complex and does not re-use the QR decomposition) * Rewrite the cache friendly product to have only one instance per scalar type ! This significantly speeds up compilation time and reduces executable size. The current drawback is that some trivial expressions might be evaluated like conjugate or negate. * Renamed "cache optimal" to "cache friendly" * Added the ability to directly access matrix data of some expressions via: - the stride()/_stride() methods - DirectAccessBit flag (replace ReferencableBit)
Diffstat (limited to 'Eigen/src/QR/QR.h')
-rw-r--r--Eigen/src/QR/QR.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/Eigen/src/QR/QR.h b/Eigen/src/QR/QR.h
index d0121cc7a..d42153eb9 100644
--- a/Eigen/src/QR/QR.h
+++ b/Eigen/src/QR/QR.h
@@ -95,10 +95,11 @@ void QR<MatrixType>::_compute(const MatrixType& matrix)
m_qr(k,k) += 1.0;
// apply transformation to remaining columns
- for (int j = k+1; j < cols; j++)
+ int remainingCols = cols - k -1;
+ if (remainingCols>0)
{
- Scalar s = -(m_qr.col(k).end(remainingSize).transpose() * m_qr.col(j).end(remainingSize))(0,0) / m_qr(k,k);
- m_qr.col(j).end(remainingSize) += s * m_qr.col(k).end(remainingSize);
+ m_qr.corner(BottomRight, remainingSize, remainingCols) -= (1./m_qr(k,k)) * m_qr.col(k).end(remainingSize)
+ * (m_qr.col(k).end(remainingSize).transpose() * m_qr.corner(BottomRight, remainingSize, remainingCols));
}
}
m_norms[k] = -nrm;