aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/inverse.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-12-09 12:43:25 -0500
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-12-09 12:43:25 -0500
commitd2e44f263631981d9e547caafe36b1de5ba785f9 (patch)
tree574d7aff0554739bea2cede8dc706cd5cd8c7c4a /test/inverse.cpp
parentf0315295e9ae2fd8afdc05d3e5b790b4660ffc58 (diff)
* 4x4 inverse: revert to cofactors method
* inverse tests: use createRandomMatrixOfRank, use more strict precision * tests: createRandomMatrixOfRank: support 1x1 matrices * determinant: nest the xpr * Minor: add comment
Diffstat (limited to 'test/inverse.cpp')
-rw-r--r--test/inverse.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/test/inverse.cpp b/test/inverse.cpp
index 59b791507..b80e139e0 100644
--- a/test/inverse.cpp
+++ b/test/inverse.cpp
@@ -38,18 +38,11 @@ template<typename MatrixType> void inverse(const MatrixType& m)
typedef typename NumTraits<Scalar>::Real RealScalar;
typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, 1> VectorType;
- MatrixType m1 = MatrixType::Random(rows, cols),
+ MatrixType m1(rows, cols),
m2(rows, cols),
mzero = MatrixType::Zero(rows, cols),
identity = MatrixType::Identity(rows, rows);
-
- if (ei_is_same_type<RealScalar,float>::ret)
- {
- // let's build a more stable to inverse matrix
- MatrixType a = MatrixType::Random(rows,cols);
- m1 += m1 * m1.adjoint() + a * a.adjoint();
- }
-
+ createRandomMatrixOfRank(rows,rows,rows,m1);
m2 = m1.inverse();
VERIFY_IS_APPROX(m1, m2.inverse() );