[eigen] Bug(s) report: SparseQR on tall-thin matrices |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: [eigen] Bug(s) report: SparseQR on tall-thin matrices*From*: Julian Kent <julian.kent@xxxxxxxxx>*Date*: Mon, 9 Jan 2017 15:51:37 +0100*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pix4d.com; s=google; h=mime-version:from:date:message-id:subject:to; bh=NAN0rg9es3X6NLg7RuM8j0XkvjKC9zOzxvFioY8SeE8=; b=l7t3fHnwbjyyfqoWMoalFb0sXjKgMRTe0nGkhwkPkgLiVw9UWinnDxV1n3udRDrpmx Wi/YBrEeOK0WqjvQj4H5GV74msul2ATHXdyyqwriAHkElhNXZVkZSlYDvk48/+Mvvwq1 Z8z3VQzOW1lfume+gG3K0+dfiFvuJ9G/r4/xs=

While trying to use SparseQR on a matrix A with rows > cols, I found 2 bugs:

1) The size of qr.matrixR() is m x n, instead of n x n as expected. SparseQR.h:305 initialises m_R with size (m,n), and nothing does any resizing. For now I'm just taking the topRows(n), but I'm not entirely sure this is correct, and it certainly isn't the behaviour I expect. Shouldn't there be a non-destructive resize, if the extra rows are really necessary for intermediate procesing?Eigen/src/SparseQR/SparseQR.h:640: void Eigen::SparseQR_QProduct<SparseQRType, Derived>::evalTo(DesType&) const [with DesType = Eigen::Matrix<double, -1, -1>; SparseQRType = Eigen::SparseQR<Eigen::SparseMatrix<double>, Eigen::NaturalOrdering<int> >; Derived = Eigen::Matrix<double, -1, -1>]: Assertion `m_qr.m_Q..rows() == m_other.rows() && "Non conforming object sizes"' failed.

In the .solve(...) only matrixQ.transpose() is used, which is probably why this hasn't shown up earlier.

These bugs may be interacting with each other to fool any accuracy tests using A*P = Q*R on tall-thin matrices, with the extra rows in R passing the assert in Q.

Let me know if you need example matrices to work with.

Thanks

Julian Kent

**Follow-Ups**:**[eigen] Re: Bug(s) report: SparseQR on tall-thin matrices***From:*Julian Kent

**Re: [eigen] Bug(s) report: SparseQR on tall-thin matrices***From:*Gael Guennebaud

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] On a flexible API for submatrices, slicing, indexing, masking, etc.** - Next by Date:
**[eigen] Re: Bug(s) report: SparseQR on tall-thin matrices** - Previous by thread:
**Re: [eigen] SparseView** - Next by thread:
**[eigen] Re: Bug(s) report: SparseQR on tall-thin matrices**

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