diff options
author | Jitse Niesen <jitse@maths.leeds.ac.uk> | 2011-06-24 13:47:11 +0100 |
---|---|---|
committer | Jitse Niesen <jitse@maths.leeds.ac.uk> | 2011-06-24 13:47:11 +0100 |
commit | 0b308e79c4731c093a8bbe2adc3bb9dc4ff3eb12 (patch) | |
tree | ec4f225488f885bfb36eb63a62e854287da73850 | |
parent | 16db255333f890d7c8e95822d70871b491e91a92 (diff) |
Add DenseStorage specializations for dynamic size with MaxSize = 0 (bug #288).
This is necessary for instantiations like Matrix<float,Dynamic,Dynamic,0,0,0>.
-rw-r--r-- | Eigen/src/Core/DenseStorage.h | 10 | ||||
-rw-r--r-- | test/zerosized.cpp | 5 |
2 files changed, 15 insertions, 0 deletions
diff --git a/Eigen/src/Core/DenseStorage.h b/Eigen/src/Core/DenseStorage.h index 813053b00..2464aaab8 100644 --- a/Eigen/src/Core/DenseStorage.h +++ b/Eigen/src/Core/DenseStorage.h @@ -128,6 +128,16 @@ template<typename T, int _Rows, int _Cols, int _Options> class DenseStorage<T, 0 inline T *data() { return 0; } }; +// more specializations for null matrices; these are necessary to resolve ambiguities +template<typename T, int _Options> class DenseStorage<T, 0, Dynamic, Dynamic, _Options> +: public DenseStorage<T, 0, 0, 0, _Options> { }; + +template<typename T, int _Rows, int _Options> class DenseStorage<T, 0, _Rows, Dynamic, _Options> +: public DenseStorage<T, 0, 0, 0, _Options> { }; + +template<typename T, int _Cols, int _Options> class DenseStorage<T, 0, Dynamic, _Cols, _Options> +: public DenseStorage<T, 0, 0, 0, _Options> { }; + // dynamic-size matrix with fixed-size storage template<typename T, int Size, int _Options> class DenseStorage<T, Size, Dynamic, Dynamic, _Options> { diff --git a/test/zerosized.cpp b/test/zerosized.cpp index 06e31cc09..c5d2cc6ed 100644 --- a/test/zerosized.cpp +++ b/test/zerosized.cpp @@ -62,8 +62,13 @@ void test_zerosized() zeroSizedMatrix<Matrix3i>(); zeroSizedMatrix<Matrix<float, 2, Dynamic> >(); zeroSizedMatrix<MatrixXf>(); + zeroSizedMatrix<Matrix<float, 0, 0> >(); + zeroSizedMatrix<Matrix<float, Dynamic, 0, 0, 0, 0> >(); + zeroSizedMatrix<Matrix<float, 0, Dynamic, 0, 0, 0> >(); + zeroSizedMatrix<Matrix<float, Dynamic, Dynamic, 0, 0, 0> >(); zeroSizedVector<Vector2d>(); zeroSizedVector<Vector3i>(); zeroSizedVector<VectorXf>(); + zeroSizedVector<Matrix<float, 0, 1> >(); } |