bug #1075: fix AlignedBox::sample for runtime dimension

(grafted from 75a60d3ac0ac10be7317b268911d0098acbbf472
)
This commit is contained in:
Gael Guennebaud 2015-09-30 11:44:02 +02:00
parent cfe315476f
commit 73cb54835c
2 changed files with 3 additions and 1 deletions

View File

@ -163,7 +163,7 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim)
* a uniform distribution */
inline VectorType sample() const
{
VectorType r;
VectorType r(dim());
for(Index d=0; d<dim(); ++d)
{
if(!ScalarTraits::IsInteger)

View File

@ -172,6 +172,8 @@ void test_geo_alignedbox()
CALL_SUBTEST_9( alignedbox(AlignedBox1i()) );
CALL_SUBTEST_10( alignedbox(AlignedBox2i()) );
CALL_SUBTEST_11( alignedbox(AlignedBox3i()) );
CALL_SUBTEST_14( alignedbox(AlignedBox<double,Dynamic>(4)) );
}
CALL_SUBTEST_12( specificTest1() );
CALL_SUBTEST_13( specificTest2() );