Constructing a Matrix/Array with implicit transpose could lead to memory leaks.

Also reduced code duplication for Matrix/Array constructors
This commit is contained in:
Christoph Hertzberg
2015-04-16 13:25:20 +02:00
parent e0cff9ae0d
commit 3be9f5c4d7
6 changed files with 76 additions and 88 deletions

View File

@@ -22,6 +22,8 @@ template<typename ArrayType> void array(const ArrayType& m)
ArrayType m1 = ArrayType::Random(rows, cols),
m2 = ArrayType::Random(rows, cols),
m3(rows, cols);
ArrayType m4 = m1; // copy constructor
VERIFY_IS_APPROX(m1, m4);
ColVectorType cv1 = ColVectorType::Random(rows);
RowVectorType rv1 = RowVectorType::Random(cols);