aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Eigen/src/Geometry/AlignedBox.h2
-rw-r--r--test/geo_alignedbox.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/Eigen/src/Geometry/AlignedBox.h b/Eigen/src/Geometry/AlignedBox.h
index 186d4ecad..03f1a11f8 100644
--- a/Eigen/src/Geometry/AlignedBox.h
+++ b/Eigen/src/Geometry/AlignedBox.h
@@ -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)
diff --git a/test/geo_alignedbox.cpp b/test/geo_alignedbox.cpp
index e2792ed18..c883234a8 100644
--- a/test/geo_alignedbox.cpp
+++ b/test/geo_alignedbox.cpp
@@ -179,6 +179,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() );