From 45cda6704a067e73711f659ec6389fae7e36d1ad Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 12 May 2008 10:23:09 +0000 Subject: * 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) --- Eigen/src/QR/QR.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Eigen/src/QR/QR.h') 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::_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; -- cgit v1.2.3