diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2011-02-01 07:46:02 -0500 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2011-02-01 07:46:02 -0500 |
commit | 2d09b11a97466c1386beb0016bc37438766535ab (patch) | |
tree | 4fac91f03f194f5703ed5e6f4212ae2ead223773 | |
parent | faa1284c12d23f780e260e4b8122ec343f7cef34 (diff) |
relax Matrix/Array(Index) ctors to allow size 0, add test.
-rw-r--r-- | Eigen/src/Core/Array.h | 2 | ||||
-rw-r--r-- | Eigen/src/Core/Matrix.h | 2 | ||||
-rw-r--r-- | doc/A05_PortingFrom2To3.dox | 6 | ||||
-rw-r--r-- | test/CMakeLists.txt | 1 |
4 files changed, 8 insertions, 3 deletions
diff --git a/Eigen/src/Core/Array.h b/Eigen/src/Core/Array.h index 68bd6c32c..598d18910 100644 --- a/Eigen/src/Core/Array.h +++ b/Eigen/src/Core/Array.h @@ -147,7 +147,7 @@ class Array { Base::_check_template_params(); EIGEN_STATIC_ASSERT_VECTOR_ONLY(Array) - eigen_assert(dim > 0); + eigen_assert(dim >= 0); eigen_assert(SizeAtCompileTime == Dynamic || SizeAtCompileTime == dim); EIGEN_INITIALIZE_BY_ZERO_IF_THAT_OPTION_IS_ENABLED } diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index f41d554ec..d304fad60 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -235,7 +235,7 @@ class Matrix { Base::_check_template_params(); EIGEN_STATIC_ASSERT_VECTOR_ONLY(Matrix) - eigen_assert(dim > 0); + eigen_assert(dim >= 0); eigen_assert(SizeAtCompileTime == Dynamic || SizeAtCompileTime == dim); EIGEN_INITIALIZE_BY_ZERO_IF_THAT_OPTION_IS_ENABLED } diff --git a/doc/A05_PortingFrom2To3.dox b/doc/A05_PortingFrom2To3.dox index 6f76d520f..37ab956c3 100644 --- a/doc/A05_PortingFrom2To3.dox +++ b/doc/A05_PortingFrom2To3.dox @@ -22,7 +22,11 @@ and gives tips to help porting your application from Eigen2 to Eigen3. \section CompatibilitySupport Eigen2 compatibility support -In order to ease the switch from Eigen2 to Eigen3, Eigen3 features a compatibility mode which can be enabled by defining the EIGEN2_SUPPORT preprocessor token \b before including any Eigen header (typically it should be set in your project options). +In order to ease the switch from Eigen2 to Eigen3, Eigen3 features a Eigen2 support modes \ref TopicResizing "this page".. + +The quick way to enable this is to define the EIGEN2_SUPPORT preprocessor token \b before including any Eigen header (typically it should be set in your project options). + +Moreover, we also provided a staged migration path which may be useful to migrate large projects \section Using The USING_PART_OF_NAMESPACE_EIGEN macro diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4a4f80155..dccddd57d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -121,6 +121,7 @@ ei_add_test(permutationmatrices) ei_add_test(eigen2support) ei_add_test(nullary) ei_add_test(nesting_ops "${CMAKE_CXX_FLAGS_DEBUG}") +ei_add_test(zerosized) ei_add_test(prec_inverse_4x4) |