Registered Member
|
hello,
I have an iterative algorithm, which deals with matrices that change size at each iteration. To this end, I would like to allocate a large matrix at the beginning to avoid memory reallocations, but do computations only with part of it. What would be the recommended way of doing this in Eigen? I tried using the MaxRows/ColsAtCompileTime parameters, but run straight into problems:
This, for some reason, gives "Segmentation fault" at conservativeResize (though not if .resize() is used instead or if 1024 is set to lower value like 512). I guess I could also just use Eigen::MatrixXd and use lots of ".block()" code, but this sounds a bit messy. A related question: are there methods for updating Cholesky factorization of a matrix when adding a row and column to the "end" of the matrix or when deleting a row and column from the matrix? (for example, http://lapmal.epfl.ch/lhotse/index.html seems to have something like these) |
Registered Member
|
Please file a bug report with a full compilable version of your example.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
I filed a bug report, although maybe this is just some stack memory issue (I'm not an expert on this...)? Is the matrix allocated on stack when giving the MaxRows/ColsAtCompileTime parameters? If so, is there any way to force it on the heap (or any other way of avoiding reallocations when resizing matrices)? |
Registered Member
|
Oh, right, I missed this --- you are indeed creating this matrix on stack, which probably explains it.
To create this matrix on the heap, well, just do MyMatrixType *m = new MyMatrixType; Sorry for that; please close the bug if that fixed it.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
It doesn't... Still Segmentation fault. Here's a code that produces the behavior for me:
|
Registered Member
|
Interesting, please update the bug with that info.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora