I am using an AlignedBoxXd, when I call sample() on it, I get an assertion failure: Assertion failed: (index >= 0 && index < size()), function operator[], file /opt/local/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h, line 378. The problems seems to be that the vector 'r' in the code below (AlignedBox.h, line 166), which is of type VectorType (I guess VectorXd in this case) is not given a size before it is used in 'r[d]' (line 171). inline VectorType sample() const 165 { 166 VectorType r; 167 for(Index d=0; d<dim(); ++d) 168 { 169 if(!ScalarTraits::IsInteger) 170 { 171 r[d] = m_min[d] + (m_max[d]-m_min[d]) 172 * internal::random<Scalar>(Scalar(0), Scalar(1)); 173 } 174 else 175 r[d] = internal::random(m_min[d], m_max[d]); 176 } 177 return r; 178 }
Thank you for the report. default: https://bitbucket.org/eigen/eigen/commits/114569164dbc/ 3.2: https://bitbucket.org/eigen/eigen/commits/9dac2e213021/
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1075.