New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!

Bug 798

Summary: SparseQR<SparseMatrix<double> >::factorize() hits assertion failure on uncompressed input matrix
Product: Eigen Reporter: renshaw
Component: SparseAssignee: Nobody <eigen.nobody>
Status: NEW ---    
Severity: Unknown    
Priority: Normal    
Version: 3.2   
Hardware: x86 - 64-bit   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
source code to reproduce the problem none

Description renshaw 2014-04-18 16:14:19 UTC
Created attachment 454 [details]
source code to reproduce the problem

When I compile and run the attached program, which constructs a 2x2 sparse matrix of doubles and attempts to perform a QR factorization, I get the following output:

Nonzero entries:
(_,_) (_,_) (0.5,1) (_,_) 

Outer pointers:
0 2  $
Inner non zeros:
0 1  $

0 0 
0 0.5 

a.out: eigen/Eigen/src/Core/DenseCoeffsBase.h:412: Eigen::DenseCoeffsBase<Derived, 1>::Scalar& Eigen::DenseCoeffsBase<Derived, 1>::operator()(Eigen::DenseCoeffsBase<Derived, 1>::Index) [with Derived = Eigen::Matrix<int, -0x00000000000000001, 1>, Eigen::DenseCoeffsBase<Derived, 1>::Scalar = int, Eigen::DenseCoeffsBase<Derived, 1>::Index = long int]: Assertion `index >= 0 && index < size()' failed.
Aborted (core dumped)



If I run the program under valgrind, I get some reports about uninitialized memory:

==20561== Conditional jump or move depends on uninitialised value(s)
==20561==    at 0x515C8A8: sqrt (w_sqrt.c:28)
==20561==    by 0x404D84: Eigen::SparseMatrixBase<Eigen::Block<Eigen::SparseMatrix<double, 0, int>, -1, 1, true> >::norm() const (SparseDot.h:90)
==20561==    by 0x402B18: Eigen::SparseQR<Eigen::SparseMatrix<double, 0, int>, Eigen::NaturalOrdering<int> >::factorize(Eigen::SparseMatrix<double, 0, int> const&) (SparseQR.h:332)
==20561==    by 0x401FC3: Eigen::SparseQR<Eigen::SparseMatrix<double, 0, int>, Eigen::NaturalOrdering<int> >::compute(Eigen::SparseMatrix<double, 0, int> const&) (SparseQR.h:87)
==20561==    by 0x400FCB: main (bug135.cpp:19)