aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-08-08 00:01:43 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-08-08 00:01:43 +0200
commitf5e1c896c7e95cecc776f20fc5663f67194a11cf (patch)
tree68544ffeb5fcaca16d496ad977c84fd0eb4398fa /Eigen
parentd1dc088ef045dcee5747b5c722f5f4f6bb58e2d1 (diff)
replace custom rank one update in LU by an expression
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/LU/LU.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/Eigen/src/LU/LU.h b/Eigen/src/LU/LU.h
index 7d688c238..43154b769 100644
--- a/Eigen/src/LU/LU.h
+++ b/Eigen/src/LU/LU.h
@@ -434,16 +434,8 @@ void LU<MatrixType>::compute(const MatrixType& matrix)
}
if(k<rows-1)
m_lu.col(k).end(rows-k-1) /= m_lu.coeff(k,k);
- if(k<size-1) {
- /* I know it's tempting to replace this for loop by a single matrix product. But actually there's no reason why it
- * should be faster because it's just an exterior vector product; and in practice this gives much slower code with
- * GCC 4.2-4.4 (this is weird, would be interesting to investigate). On the other hand, it would be worth having a variant
- * for row-major matrices, traversing in the other direction for better performance, with a meta selector to compile only
- * one path
- */
- for(int col = k + 1; col < cols; ++col)
- m_lu.col(col).end(rows-k-1) -= m_lu.col(k).end(rows-k-1) * m_lu.coeff(k,col);
- }
+ if(k<size-1)
+ m_lu.block(k+1,k+1,rows-k-1,cols-k-1) -= m_lu.col(k).end(rows-k-1) * m_lu.row(k).end(cols-k-1);
}
for(int k = 0; k < matrix.rows(); ++k) m_p.coeffRef(k) = k;