aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2013-11-19 12:53:46 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2013-11-19 12:53:46 +0100
commit28b2abdbea00ab7c37e690679e6e4398ab300978 (patch)
tree76e5560ba955a147d1e030ff51ee60d02d60fe3c
parent654eab3bd6dc842c668d8979eb36602cef929165 (diff)
Fix FullPivHouseholderQR ctors for non squared fixed size matrix types
-rw-r--r--Eigen/src/QR/FullPivHouseholderQR.h12
-rw-r--r--test/qr_fullpivoting.cpp4
2 files changed, 10 insertions, 6 deletions
diff --git a/Eigen/src/QR/FullPivHouseholderQR.h b/Eigen/src/QR/FullPivHouseholderQR.h
index 13e14db10..e6ab172b3 100644
--- a/Eigen/src/QR/FullPivHouseholderQR.h
+++ b/Eigen/src/QR/FullPivHouseholderQR.h
@@ -94,10 +94,10 @@ template<typename _MatrixType> class FullPivHouseholderQR
FullPivHouseholderQR(Index rows, Index cols)
: m_qr(rows, cols),
m_hCoeffs((std::min)(rows,cols)),
- m_rows_transpositions(rows),
- m_cols_transpositions(cols),
+ m_rows_transpositions((std::min)(rows,cols)),
+ m_cols_transpositions((std::min)(rows,cols)),
m_cols_permutation(cols),
- m_temp((std::min)(rows,cols)),
+ m_temp(cols),
m_isInitialized(false),
m_usePrescribedThreshold(false) {}
@@ -116,10 +116,10 @@ template<typename _MatrixType> class FullPivHouseholderQR
FullPivHouseholderQR(const MatrixType& matrix)
: m_qr(matrix.rows(), matrix.cols()),
m_hCoeffs((std::min)(matrix.rows(), matrix.cols())),
- m_rows_transpositions(matrix.rows()),
- m_cols_transpositions(matrix.cols()),
+ m_rows_transpositions((std::min)(matrix.rows(), matrix.cols())),
+ m_cols_transpositions((std::min)(matrix.rows(), matrix.cols())),
m_cols_permutation(matrix.cols()),
- m_temp((std::min)(matrix.rows(), matrix.cols())),
+ m_temp(matrix.cols()),
m_isInitialized(false),
m_usePrescribedThreshold(false)
{
diff --git a/test/qr_fullpivoting.cpp b/test/qr_fullpivoting.cpp
index 15d7299d7..511f2473f 100644
--- a/test/qr_fullpivoting.cpp
+++ b/test/qr_fullpivoting.cpp
@@ -130,4 +130,8 @@ void test_qr_fullpivoting()
// Test problem size constructors
CALL_SUBTEST_7(FullPivHouseholderQR<MatrixXf>(10, 20));
+ CALL_SUBTEST_7((FullPivHouseholderQR<Matrix<float,10,20> >(10,20)));
+ CALL_SUBTEST_7((FullPivHouseholderQR<Matrix<float,10,20> >(Matrix<float,10,20>::Random())));
+ CALL_SUBTEST_7((FullPivHouseholderQR<Matrix<float,20,10> >(20,10)));
+ CALL_SUBTEST_7((FullPivHouseholderQR<Matrix<float,20,10> >(Matrix<float,20,10>::Random())));
}