Hello,
I'm trying to use the SVD in a real-time
process, so I can't do any malloc. I found that my SVD (JacobiSVD) was doing
some malloc, even when the pre-allocation ctor is used. The jacobi unit tests
(jacobisvd_preallocate) does make this validation, but only for a square 3x3
matrix. The same test fail when using non-square matrices. Here is an example
of a failing test:
bool
testSVDNoMalloc()
{
const int rows =
15;
const int cols = 15;
Eigen::MatrixXd A =
Eigen::MatrixXd::Random(rows, cols);
Eigen::JacobiSVD<Eigen::MatrixXd> svd1(rows,
cols);
Eigen::internal::set_is_malloc_allowed(false);
svd1.compute(A);
Eigen::internal::set_is_malloc_allowed(true);
return
true;
}
Is this a bug or maybe I misunderstood
something?