Re: [eigen] compilation error, 3.3rc2 and MS VS2013

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


Hi,

as explained there: http://eigen.tuxfamily.org/index.php?title=3.3#Index_typedef, you have to use SparseMat::StorageIndex instead of SparseMat::Index.

Then, there is also an issue in printing the _expression_ R11. I'll have a look (that will be an easy fix). In the meantime you can do cout << R11.eval();.

gael

On Wed, Nov 9, 2016 at 11:54 PM, Bill Greene <w.h.greene@xxxxxxxxx> wrote:
I have some code that compiles correctly with 3.2.9 but not with 3.3rc2.
I've managed to reproduce the problem with the following simple test:

typedef Eigen::MatrixXd DenseMat;
typedef Eigen::VectorXd Vector;
typedef Eigen::SparseMatrix<double> SparseMat;
void icTestSparseSimple()
{
  typedef Eigen::SparseQR<SparseMat, Eigen::COLAMDOrdering< SparseMat::Index >> SparseQR;
  const int n = 4;
  DenseMat a(n, n);
  a <<
    1, 0, 0, 0,
    -30, 60, -30, 0,
    0, -30, 60, -30,
    0, 0, -30, 30;
  SparseMat as = a.sparseView();
  SparseQR qr(as);
  cout << "R\n" << qr.matrixR() << endl;
  int rnk = qr.rank();
  cout << "rank=" << rnk << endl;
  auto R11 = qr.matrixR().topLeftCorner(rnk, rnk).triangularView<Eigen::Upper>();
  cout << "R11\n" << R11 << endl;
}

I get many error messages complaining about the line starting with "auto R11".
I'm wondering if this code is "bad" for some reason and I was simply lucky
in 3.2.9 or if this is a problem with 3.3.

Thanks,

Bill Greene




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