12 #define VERIFY_TRSM(TRI,XB) { \ 13 (XB).setRandom(); ref = (XB); \ 14 (TRI).solveInPlace(XB); \ 15 VERIFY_IS_APPROX((TRI).toDenseMatrix() * (XB), ref); \ 16 (XB).setRandom(); ref = (XB); \ 17 (XB) = (TRI).solve(XB); \ 18 VERIFY_IS_APPROX((TRI).toDenseMatrix() * (XB), ref); \ 21 #define VERIFY_TRSM_ONTHERIGHT(TRI,XB) { \ 22 (XB).setRandom(); ref = (XB); \ 23 (TRI).transpose().template solveInPlace<OnTheRight>(XB.transpose()); \ 24 VERIFY_IS_APPROX((XB).transpose() * (TRI).transpose().toDenseMatrix(), ref.transpose()); \ 25 (XB).setRandom(); ref = (XB); \ 26 (XB).transpose() = (TRI).transpose().template solve<OnTheRight>(XB.transpose()); \ 27 VERIFY_IS_APPROX((XB).transpose() * (TRI).transpose().toDenseMatrix(), ref.transpose()); \ 43 cmLhs.
setRandom(); cmLhs *=
static_cast<RealScalar
>(0.1); cmLhs.diagonal().array() +=
static_cast<RealScalar
>(1);
44 rmLhs.
setRandom(); rmLhs *=
static_cast<RealScalar
>(0.1); rmLhs.diagonal().array() +=
static_cast<RealScalar
>(1);
48 VERIFY_TRSM(cmLhs .
template triangularView<Upper>(), cmRhs);
50 VERIFY_TRSM(cmLhs.conjugate().template triangularView<Upper>(), rmRhs);
51 VERIFY_TRSM(cmLhs.adjoint() .template triangularView<Upper>(), rmRhs);
53 VERIFY_TRSM(cmLhs.conjugate().template triangularView<UnitLower>(), cmRhs);
54 VERIFY_TRSM(cmLhs .
template triangularView<UnitUpper>(), rmRhs);
57 VERIFY_TRSM(rmLhs.conjugate().template triangularView<UnitUpper>(), rmRhs);
71 int c = internal::random<int>(0,
cols-1);
93 CALL_SUBTEST_9((trsolve<float,4,1>()));
94 CALL_SUBTEST_10((trsolve<double,4,1>()));
95 CALL_SUBTEST_11((
trsolve<std::complex<float>,4,1>()));
96 CALL_SUBTEST_12((trsolve<float,1,1>()));
97 CALL_SUBTEST_13((trsolve<float,1,2>()));
98 CALL_SUBTEST_14((trsolve<float,3,1>()));
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
#define VERIFY_TRSM_ONTHERIGHT(TRI, XB)
void trsolve(int size=Size, int cols=Cols)
NumTraits< Scalar >::Real RealScalar
#define EIGEN_TEST_MAX_SIZE
A triangularView< Lower >().adjoint().solveInPlace(B)
void test_product_trsolve()
#define VERIFY_TRSM(TRI, XB)
The matrix class, also used for vectors and row-vectors.
Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & setRandom(Index size)