10 #define EIGEN_NO_STATIC_ASSERT 23 matAstatic.cwiseProduct(matBstatic.transpose()).sum() );
25 MatrixXf matAdynamic(1,3);
26 MatrixXf matBdynamic(3,1);
27 matAdynamic.setRandom();
28 matBdynamic.setRandom();
30 matAdynamic.cwiseProduct(matBdynamic.transpose()).sum() );
33 template<
typename TC,
typename TA,
typename TB>
38 for(
Index k=0;k<A.cols();++k)
39 C.coeffRef(
i,
j) += A.coeff(
i,k) * B.coeff(k,
j);
43 template<
typename T,
int Rows,
int Cols,
int Depth,
int OC,
int OA,
int OB>
44 typename internal::enable_if<! ( (Rows ==1&&Depth!=1&&OA==
ColMajor)
45 || (Depth==1&&Rows !=1&&OA==
RowMajor)
61 int rows = internal::random<int>(1,64);
62 int cols = internal::random<int>(1,64);
63 int depth = internal::random<int>(1,65);
66 MatrixX
A(rows,depth); A.setRandom();
67 MatrixX
B(depth,cols); B.setRandom();
68 MatrixX
C(rows,cols); C.setRandom();
72 for(
Index k=0;k<A.cols();++k)
73 D.coeffRef(
i,
j) |= A.coeff(
i,k) & B.coeff(k,
j);
77 MatrixX
E = B.transpose();
83 template<
typename T,
int Rows,
int Cols,
int Depth,
int OC,
int OA,
int OB>
84 typename internal::enable_if< ( (Rows ==1&&Depth!=1&&OA==
ColMajor)
85 || (Depth==1&&Rows !=1&&OA==
RowMajor)
94 template<
typename T,
int Rows,
int Cols,
int Depth>
97 CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,ColMajor,ColMajor,ColMajor>(rows,cols,depth) ));
98 CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,RowMajor,ColMajor,ColMajor>(rows,cols,depth) ));
99 CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,ColMajor,RowMajor,ColMajor>(rows,cols,depth) ));
100 CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,RowMajor,RowMajor,ColMajor>(rows,cols,depth) ));
101 CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,ColMajor,ColMajor,RowMajor>(rows,cols,depth) ));
102 CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,RowMajor,ColMajor,RowMajor>(rows,cols,depth) ));
103 CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,ColMajor,RowMajor,RowMajor>(rows,cols,depth) ));
104 CALL_SUBTEST(( test_lazy_single<T,Rows,Cols,Depth,RowMajor,RowMajor,RowMajor>(rows,cols,depth) ));
110 int rows = internal::random<int>(1,12);
111 int cols = internal::random<int>(1,12);
112 int depth = internal::random<int>(1,12);
120 CALL_SUBTEST(( test_lazy_all_layout<T,1,1,-1>(1,1,depth) ));
129 CALL_SUBTEST(( test_lazy_all_layout<T,4,-1,1>(4,cols) ));
130 CALL_SUBTEST(( test_lazy_all_layout<T,7,-1,1>(7,cols) ));
133 CALL_SUBTEST(( test_lazy_all_layout<T,-1,-1,1>(rows,cols) ));
139 int rows = internal::random<int>(1,12);
140 int cols = internal::random<int>(1,12);
141 int depth = internal::random<int>(1,12);
154 CALL_SUBTEST(( test_lazy_all_layout<T,4,1,-1>(4,1,depth) ));
155 CALL_SUBTEST(( test_lazy_all_layout<T,-1,1,-1>(rows,1,depth) ));
167 CALL_SUBTEST(( test_lazy_all_layout<T,1,-1, 4>(1,cols) ));
168 CALL_SUBTEST(( test_lazy_all_layout<T,1, 4,-1>(1,4,depth) ));
169 CALL_SUBTEST(( test_lazy_all_layout<T,1,-1,-1>(1,cols,depth) ));
175 int rows = internal::random<int>(1,12);
176 int cols = internal::random<int>(1,12);
177 int depth = internal::random<int>(1,12);
189 CALL_SUBTEST(( test_lazy_all_layout<T,4,3,-1>(4,3,depth) ));
190 CALL_SUBTEST(( test_lazy_all_layout<T,-1,6,-1>(rows,6,depth) ));
200 CALL_SUBTEST(( test_lazy_all_layout<T,8,-1, 4>(8,cols) ));
201 CALL_SUBTEST(( test_lazy_all_layout<T,3, 4,-1>(3,4,depth) ));
202 CALL_SUBTEST(( test_lazy_all_layout<T,4,-1,-1>(4,cols,depth) ));
205 template<
typename T,
int N,
int M,
int K>
220 C.noalias() = A.template topLeftCorner<1,M>() * (B.template topRows<M>()+B.template bottomRows<M>());
221 R.noalias() = A.template topLeftCorner<1,M>() * (B.template topRows<M>()+B.template bottomRows<M>()).eval();
231 C.noalias() = (B.template leftCols<M>()+B.template rightCols<M>()) * A.template topLeftCorner<M,1>();
232 R.noalias() = (B.template leftCols<M>()+B.template rightCols<M>()).
eval() * A.template topLeftCorner<M,1>();
241 Vector2d
b = Vector2d::Random() ;
243 res.noalias() = 1. * (A *
b);
245 res.noalias() = 1.*A *
b;
247 res.noalias() = (1.*
A).lazyProduct(b);
249 res.noalias() = (1.*
A).lazyProduct(1.*b);
251 res.noalias() = (
A).lazyProduct(1.*b);
260 Vector3f
v = Vector3f::Random();
277 for(
int k=0; k<79; ++k)
279 B.noalias() = (((A*
A)*(A*A))*((A*A)*(A*
A))*((A*
A)*(A*A))*((A*A)*(A*
A))*((A*
A)*(A*A)) * ((A*A)*(A*
A))*((A*
A)*(A*A))*((A*A)*(A*
A))*((A*
A)*(A*A))*((A*A)*(A*
A)))
280 * (((A*A)*(A*
A))*((A*
A)*(A*A))*((A*A)*(A*
A))*((A*
A)*(A*A))*((A*A)*(A*
A)) * ((A*
A)*(A*A))*((A*A)*(A*
A))*((A*
A)*(A*A))*((A*A)*(A*
A))*((A*
A)*(A*A)));
312 CALL_SUBTEST_7(( test_linear_but_not_vectorizable<float,2,1,Dynamic>() ));
313 CALL_SUBTEST_7(( test_linear_but_not_vectorizable<float,3,1,Dynamic>() ));
314 CALL_SUBTEST_7(( test_linear_but_not_vectorizable<float,2,1,16>() ));
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
#define CALL_SUBTEST_12(FUNC)
#define CALL_SUBTEST_9(FUNC)
#define CALL_SUBTEST_6(FUNC)
void test_lazy_all_layout(int rows=Rows, int cols=Cols, int depth=Depth)
#define CALL_SUBTEST_4(FUNC)
Matrix< RealScalar, Dynamic, Dynamic > M
EIGEN_DECLARE_TEST(product_small)
#define CALL_SUBTEST_33(FUNC)
#define CALL_SUBTEST_13(FUNC)
#define CALL_SUBTEST_3(FUNC)
#define CALL_SUBTEST_7(FUNC)
Rot2 R(Rot2::fromAngle(0.1))
#define CALL_SUBTEST_31(FUNC)
#define CALL_SUBTEST_11(FUNC)
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
void test_linear_but_not_vectorizable()
#define CALL_SUBTEST_22(FUNC)
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
#define CALL_SUBTEST_23(FUNC)
#define VERIFY_IS_APPROX(a, b)
#define CALL_SUBTEST_42(FUNC)
#define VERIFY_IS_EQUAL(a, b)
#define CALL_SUBTEST_1(FUNC)
#define CALL_SUBTEST_41(FUNC)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Array< int, Dynamic, 1 > v
#define CALL_SUBTEST_8(FUNC)
#define CALL_SUBTEST_21(FUNC)
Matrix< Scalar, Dynamic, Dynamic > C
#define CALL_SUBTEST_5(FUNC)
#define CALL_SUBTEST(FUNC)
void product_small_regressions()
internal::enable_if<!((Rows==1 &&Depth!=1 &&OA==ColMajor)||(Depth==1 &&Rows !=1 &&OA==RowMajor)||(Cols==1 &&Depth!=1 &&OB==RowMajor)||(Depth==1 &&Cols !=1 &&OB==ColMajor)||(Rows==1 &&Cols !=1 &&OC==ColMajor)||(Cols==1 &&Rows !=1 &&OC==RowMajor)), void >::type test_lazy_single(int rows, int cols, int depth)
#define CALL_SUBTEST_2(FUNC)
internal::nested_eval< T, 1 >::type eval(const T &xpr)
#define CALL_SUBTEST_43(FUNC)
The matrix class, also used for vectors and row-vectors.
#define CALL_SUBTEST_32(FUNC)
Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > & setRandom(Index size)
const TC & ref_prod(TC &C, const TA &A, const TB &B)
void product(const MatrixType &m)