27 identity = MatrixType::Identity(rows, rows);
42 #if !defined(EIGEN_TEST_PART_5) && !defined(EIGEN_TEST_PART_6) 52 m1.computeInverseAndDetWithCheck(
m2, det, invertible);
58 m1.computeInverseWithCheck(m2, invertible);
63 VectorType
v3 = VectorType::Random(rows);
64 MatrixType m3 = v3*v3.transpose(), m4(rows,cols);
65 m3.computeInverseAndDetWithCheck(m4, det, invertible);
66 VERIFY( rows==1 ? invertible : !invertible );
68 m3.computeInverseWithCheck(m4, invertible);
69 VERIFY( rows==1 ? invertible : !invertible );
75 m5.topLeftCorner(rows,rows) =
m1;
76 m2 = m5.template topLeftCorner<MatrixType::RowsAtCompileTime,MatrixType::ColsAtCompileTime>().
inverse();
77 VERIFY_IS_APPROX( (m5.template topLeftCorner<MatrixType::RowsAtCompileTime,MatrixType::ColsAtCompileTime>()), m2.inverse() );
82 if(MatrixType::RowsAtCompileTime>=2 && MatrixType::RowsAtCompileTime<=4)
100 CALL_SUBTEST_2(
inverse(Matrix2d()) );
101 CALL_SUBTEST_3(
inverse(Matrix3f()) );
102 CALL_SUBTEST_4(
inverse(Matrix4f()) );
105 s = internal::random<int>(50,320);
106 CALL_SUBTEST_5(
inverse(MatrixXf(s,s)) );
109 s = internal::random<int>(25,100);
110 CALL_SUBTEST_6(
inverse(MatrixXcd(s,s)) );
113 CALL_SUBTEST_7(
inverse(Matrix4d()) );
116 CALL_SUBTEST_8(
inverse(Matrix4cd()) );
#define VERIFY_RAISES_ASSERT(a)
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
#define VERIFY_IS_APPROX(a, b)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
NumTraits< Scalar >::Real RealScalar
#define VERIFY_IS_MUCH_SMALLER_THAN(a, b)
void inverse(const MatrixType &m)
#define TEST_SET_BUT_UNUSED_VARIABLE(X)
void createRandomPIMatrixOfRank(Index desired_rank, Index rows, Index cols, MatrixType &m)
The matrix class, also used for vectors and row-vectors.
Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & setRandom(Index size)