17 return internal::random<int>(1,max_test_size);
20 template<
typename Scalar,
int Mode,
int TriOrder,
int OtherOrder,
int ResOrder,
int OtherCols>
22 int cols=get_random_size<Scalar>(),
23 int otherCols = OtherCols==
Dynamic?get_random_size<Scalar>():OtherCols)
36 ResSX ge_sx, ge_sx_save;
37 ResXS ge_xs, ge_xs_save;
39 Scalar s1 = internal::random<Scalar>(),
40 s2 = internal::random<Scalar>();
43 tri =
mat.template triangularView<Mode>();
44 triTr =
mat.transpose().template triangularView<Mode>();
45 s1tri = (s1*
mat).
template triangularView<Mode>();
46 s1triTr = (s1*
mat).transpose().template triangularView<Mode>();
57 VERIFY_IS_APPROX( ge_xs.noalias() = (s1*
mat.adjoint()).template triangularView<Mode>() * (s2*ge_left.transpose()), s1*triTr.conjugate() * (s2*ge_left.transpose()));
59 VERIFY_IS_APPROX( ge_xs.noalias() = (s1*
mat.transpose()).template triangularView<Mode>() * (s2*ge_left.transpose()), s1triTr * (s2*ge_left.transpose()));
60 VERIFY_IS_APPROX( ge_sx.noalias() = (s2*ge_left) * (s1*
mat).template triangularView<Mode>(), (s2*ge_left)*s1tri);
62 VERIFY_IS_APPROX( ge_sx.noalias() = ge_right.transpose() *
mat.adjoint().template triangularView<Mode>(), ge_right.transpose() * triTr.conjugate());
63 VERIFY_IS_APPROX( ge_sx.noalias() = ge_right.adjoint() *
mat.adjoint().template triangularView<Mode>(), ge_right.adjoint() * triTr.conjugate());
67 VERIFY_IS_APPROX( (ge_xs_save + s1*triTr.conjugate() * (s2*ge_left.adjoint())).eval(), ge_xs.noalias() += (s1*
mat.adjoint()).template triangularView<Mode>() * (s2*ge_left.adjoint()) );
69 VERIFY_IS_APPROX( (ge_xs_save + s1triTr * (s2*ge_left.adjoint())).eval(), ge_xs.noalias() += (s1*
mat.transpose()).template triangularView<Mode>() * (s2*ge_left.adjoint()) );
73 VERIFY_IS_APPROX( ge_sx_save - (ge_right.adjoint() * (-s1 * triTr).conjugate()).eval(), ge_sx.noalias() -= (ge_right.adjoint() * (-s1 *
mat).adjoint().template triangularView<Mode>()).eval());
77 VERIFY_IS_APPROX( ge_xs = (s1*
mat).transpose().
template triangularView<Mode>() * ge_left.adjoint(), s1triTr * ge_left.adjoint());
86 MatrixX
buffer(2*ge_xs.rows(),2*ge_xs.cols());
93 template<
typename Scalar,
int Mode,
int TriOrder>
94 void trmv(
int rows=get_random_size<Scalar>(),
int cols=get_random_size<Scalar>())
96 trmm<Scalar,Mode,TriOrder,ColMajor,ColMajor,1>(
rows,
cols,1);
99 template<
typename Scalar,
int Mode,
int TriOrder,
int OtherOrder,
int ResOrder>
100 void trmm(
int rows=get_random_size<Scalar>(),
int cols=get_random_size<Scalar>(),
int otherCols = get_random_size<Scalar>())
102 trmm<Scalar,Mode,TriOrder,OtherOrder,ResOrder,Dynamic>(
rows,
cols,otherCols);
105 #define CALL_ALL_ORDERS(NB,SCALAR,MODE) \
106 EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, ColMajor,ColMajor,ColMajor>())); \
107 EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, ColMajor,ColMajor,RowMajor>())); \
108 EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, ColMajor,RowMajor,ColMajor>())); \
109 EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, ColMajor,RowMajor,RowMajor>())); \
110 EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, RowMajor,ColMajor,ColMajor>())); \
111 EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, RowMajor,ColMajor,RowMajor>())); \
112 EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, RowMajor,RowMajor,ColMajor>())); \
113 EIGEN_CAT(CALL_SUBTEST_,NB)((trmm<SCALAR, MODE, RowMajor,RowMajor,RowMajor>())); \
115 EIGEN_CAT(CALL_SUBTEST_1,NB)((trmv<SCALAR, MODE, ColMajor>())); \
116 EIGEN_CAT(CALL_SUBTEST_1,NB)((trmv<SCALAR, MODE, RowMajor>()));
119 #define CALL_ALL(NB,SCALAR) \
120 CALL_ALL_ORDERS(EIGEN_CAT(1,NB),SCALAR,Upper) \
121 CALL_ALL_ORDERS(EIGEN_CAT(2,NB),SCALAR,UnitUpper) \
122 CALL_ALL_ORDERS(EIGEN_CAT(3,NB),SCALAR,StrictlyUpper) \
123 CALL_ALL_ORDERS(EIGEN_CAT(1,NB),SCALAR,Lower) \
124 CALL_ALL_ORDERS(EIGEN_CAT(2,NB),SCALAR,UnitLower) \
125 CALL_ALL_ORDERS(EIGEN_CAT(3,NB),SCALAR,StrictlyLower)