Re: [eigen] Eigen2: Assert failure in QR

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Fix attached. How did this ever work before?

Keir

On Thu, Jul 15, 2010 at 9:55 AM, Sameer Agarwal <sameeragarwal@xxxxxxxxxx> wrote:
Hi Guys,
Maps and QR in Eigen2 triggers an assert error, depending on whether
-DNDEBUG is used or not.

eigen# g++ qr_test.cc -o qr1

eigen# ./qr1
Assertion failed: (rows == this->rows()), function resize, file
Eigen/src/Core/Map.h, line 84.
Abort trap

eigen# g++ qr_test.cc -DNDEBUG -o qr2
eigen# ./qr2

This is against Eigen 2.0.14.
Sameer

--- eigen/Eigen/src/QR/QR.h	2010-06-22 19:22:11.000000000 -0700
+++ /tmp/QR.h	2010-07-15 10:57:10.000000000 -0700
@@ -270,7 +270,7 @@
   ei_assert(m_isInitialized && "QR is not initialized.");
   const int rows = m_qr.rows();
   ei_assert(b.rows() == rows);
-  result->resize(rows, b.cols());
+  result->resize(m_qr.cols(), b.cols());
   
   // TODO(keir): There is almost certainly a faster way to multiply by
   // Q^T without explicitly forming matrixQ(). Investigate.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/