Registered Member
|
Dear all,
I try to store multiple Eigen::Matrix objects in an array, e.g.
and also
When I try to initialise the matrices by calling
I receive the following error using valgrind (V 3.12.0) ==87413== Invalid free() / delete / delete[] / realloc() ==87413== at 0x100130A65: free (in /usr/local/homebrew/Cellar/valgrind/3.12.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) ==87413== by 0x100051654: Eigen::internal::aligned_free(void*) (Memory.h:177) ==87413== by 0x100051634: void Eigen::internal::conditional_aligned_free<true>(void*) (Memory.h:230) ==87413== by 0x10005175B: void Eigen::internal::conditional_aligned_delete_auto<double, true>(double*, unsigned long) (Memory.h:416) ==87413== by 0x100077264: Eigen::DenseStorage<double, -1, -1, -1, 0>::resize(int, int, int) (DenseStorage.h:401) ==87413== by 0x100077029: Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >::resize(int, int) (PlainObjectBase.h:287) ==87413== by 0x10007C074: Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >::setZero(int, int) (CwiseNullaryOp.h:535) When I replace the array of matrices by
this error does not occur. Any help is appreciated. Best, Matthias |
Moderator
|
I cannot reproduce with:
Please provide a self-contained example. You are likely doing something wrong in-between the declaration and its use. |
Registered Member
|
My apologise. The problem was not due to Eigen but due to a complicated (and thus wrong) recursive compile-time computation of the array size.
|
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]