[go: up one dir, main page]

Wrong Index type of Eigen::SparseMatrix

Submitted by citibeth

Assigned to Nobody

Link to original bugzilla bug (#1370)
Version: 3.3 (current stable)

Description

I'm looking at: https://eigen.tuxfamily.org/dox/classEigen_1_1SparseMatrix.html
I'm using Eigen 3.3.1. Consider the following test program:

void take_int(int *ix) {}
void take_long(long *ix) {}
void test_eigen()
{
// Test 1
typename Eigen::SparseMatrix<double,0,int>::Index ix_int;
take_int(&ix_int); // Error here
take_long(&ix_int);

// Test 2  
typename Eigen::SparseMatrix<double,0,long>::Index ix_long;  
take_int(&ix_long);    // Error here  
take_long(&ix_long);  

}

The docs indicate that EigenSparseMatrix::Index should be int in Test1 and long in Test2. However, trying to compile this indicates that it is long in both times; and that the _Index template argument to Eigen::SparseMatrix seems to be ignored.

Edited by Eigen Bugzilla