aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-01-11 15:56:21 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-01-11 15:56:21 +0000
commitbcf7b291853eba135c3b63d3484ddd14c750b246 (patch)
treee5471155293c1151053a5a39a3605375bf63df87 /test
parente092cbc75cadef1158d43f07b32e4ae0bf9372e2 (diff)
rework Identity API: no longer restricted to square matrices
Diffstat (limited to 'test')
-rw-r--r--test/adjoint.cpp2
-rw-r--r--test/basicstuff.cpp2
-rw-r--r--test/linearstructure.cpp2
-rw-r--r--test/miscmatrices.cpp2
-rw-r--r--test/product.cpp4
-rw-r--r--test/submatrices.cpp2
6 files changed, 7 insertions, 7 deletions
diff --git a/test/adjoint.cpp b/test/adjoint.cpp
index 4b6b692e4..f6cd53631 100644
--- a/test/adjoint.cpp
+++ b/test/adjoint.cpp
@@ -43,7 +43,7 @@ template<typename MatrixType> void adjoint(const MatrixType& m)
m3(rows, cols),
mzero = MatrixType::zero(rows, cols),
identity = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
- ::identity(rows),
+ ::identity(rows, rows),
square = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
::random(rows, rows);
VectorType v1 = VectorType::random(rows),
diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp
index d5732dde7..f8a651a73 100644
--- a/test/basicstuff.cpp
+++ b/test/basicstuff.cpp
@@ -42,7 +42,7 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
m3(rows, cols),
mzero = MatrixType::zero(rows, cols),
identity = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
- ::identity(rows),
+ ::identity(rows, rows),
square = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
::random(rows, rows);
VectorType v1 = VectorType::random(rows),
diff --git a/test/linearstructure.cpp b/test/linearstructure.cpp
index c90488dd0..682315c7a 100644
--- a/test/linearstructure.cpp
+++ b/test/linearstructure.cpp
@@ -46,7 +46,7 @@ template<typename MatrixType> void linearStructure(const MatrixType& m)
m3(rows, cols),
mzero = MatrixType::zero(rows, cols),
identity = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
- ::identity(rows),
+ ::identity(rows, rows),
square = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
::random(rows, rows);
VectorType v1 = VectorType::random(rows),
diff --git a/test/miscmatrices.cpp b/test/miscmatrices.cpp
index 57d6f94eb..42f808b1a 100644
--- a/test/miscmatrices.cpp
+++ b/test/miscmatrices.cpp
@@ -51,7 +51,7 @@ template<typename MatrixType> void miscMatrices(const MatrixType& m)
else VERIFY_IS_MUCH_SMALLER_THAN(square(r,r2), static_cast<Scalar>(1));
square = MatrixType::zero(rows, rows);
square.diagonal() = VectorType::ones(rows);
- VERIFY_IS_APPROX(square, MatrixType::identity(rows));
+ VERIFY_IS_APPROX(square, MatrixType::identity(rows, rows));
}
void EigenTest::testMiscMatrices()
diff --git a/test/product.cpp b/test/product.cpp
index 449c0f3f7..9bba45c48 100644
--- a/test/product.cpp
+++ b/test/product.cpp
@@ -46,7 +46,7 @@ template<typename MatrixType> void product(const MatrixType& m)
m3(rows, cols),
mzero = MatrixType::zero(rows, cols),
identity = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
- ::identity(rows),
+ ::identity(rows, rows),
square = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
::random(rows, rows);
VectorType v1 = VectorType::random(rows),
@@ -83,7 +83,7 @@ template<typename MatrixType> void product(const MatrixType& m)
VERIFY_IS_APPROX(m1, identity*m1);
VERIFY_IS_APPROX(v1, identity*v1);
// again, test operator() to check const-qualification
- VERIFY_IS_APPROX(MatrixType::identity(std::max(rows,cols))(r,c), static_cast<Scalar>(r==c));
+ VERIFY_IS_APPROX(MatrixType::identity(rows, cols)(r,c), static_cast<Scalar>(r==c));
}
void EigenTest::testProduct()
diff --git a/test/submatrices.cpp b/test/submatrices.cpp
index 9981d9f83..ee0e49642 100644
--- a/test/submatrices.cpp
+++ b/test/submatrices.cpp
@@ -44,7 +44,7 @@ template<typename MatrixType> void submatrices(const MatrixType& m)
m3(rows, cols),
mzero = MatrixType::zero(rows, cols),
identity = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
- ::identity(rows),
+ ::identity(rows, rows),
square = Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, MatrixType::Traits::RowsAtCompileTime>
::random(rows, rows);
VectorType v1 = VectorType::random(rows),