[eigen] Strange behaviour with part<> in eigen2

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


Consider the following two programs

#include "Eigen/Core"
#include "Eigen/LU"

void Bar() {
  typedef Eigen::Matrix<double, 3,3, Eigen::RowMajor> MType;
  MType A  = MType::Identity();
  MType B;

  A.part<Eigen::SelfAdjoint>().computeInverse(&B);
}

int main(int argc, char** argv) {
  Bar();
  return 0;
}

and this compiles. No problem.  Now consider

#include "Eigen/Core"
#include "Eigen/LU"

template <int block_size>
void Bar() {
 typedef Eigen::Matrix<double, block_size, block_size, Eigen::RowMajor> MType;
  MType A  = MType::Identity();
  MType B;

  A.part<Eigen::SelfAdjoint>().computeInverse(&B);
}
int main(int argc, char** argv) {

  Bar<3>();
  return 0;
}

with gcc 4.4.3 we get the errors

test_eigen.cc: In function ‘void Bar()’:
test_eigen.cc:11: error: expected primary-_expression_ before ‘)’ token
test_eigen.cc: In function ‘void Bar() [with int block_size = 3]’:
test_eigen.cc:15:   instantiated from here
test_eigen.cc:11: error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘const unsigned int’ to binary ‘operator<’

Any ideas what is going on here?

Sameer



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