10 #define EIGEN_NO_STATIC_ASSERT // otherwise we fail at compile time on unused paths
13 template<
typename MatrixType,
typename Index,
typename Scalar>
26 template<
typename MatrixType,
typename Index,
typename Scalar>
33 template<
typename T1,
typename T2>
59 Scalar s1 = internal::random<Scalar>();
72 m1.row(
r1) += s1 * m1_copy.row(
r2);
75 m1.row(
r1).row(0) += s1 * m1_copy.row(
r2);
78 m1.col(
c1) += s1 * m1_copy.col(
c2);
80 m1.col(
c1).col(0) += s1 * m1_copy.col(
c2);
87 RowVectorType br1(
m1.block(
r1,0,1,
cols));
96 const Index BlockRows = 2;
97 const Index BlockCols = 5;
102 m1.template block<BlockRows,BlockCols>(1,1) *= s1;
104 m1.template block<BlockRows,BlockCols>(1,1)(0, 3) =
m1.template block<2,5>(1,1)(1,2);
110 m1.template block<BlockRows,Dynamic>(1,1,BlockRows,BlockCols) *= s1;
111 m1.template block<BlockRows,Dynamic>(1,1,BlockRows,BlockCols)(0,3) =
m1.template block<2,5>(1,1)(1,2);
115 VERIFY(
is_same_block(
m1.block(3,3,BlockRows,BlockCols),
m1.block(3,3,fix<Dynamic>(BlockRows),fix<Dynamic>(BlockCols))));
116 VERIFY(
is_same_block(
m1.template block<BlockRows,Dynamic>(1,1,BlockRows,BlockCols),
m1.block(1,1,fix<BlockRows>,BlockCols)));
117 VERIFY(
is_same_block(
m1.template block<BlockRows,BlockCols>(1,1,BlockRows,BlockCols),
m1.block(1,1,fix<BlockRows>(),fix<BlockCols>)));
118 VERIFY(
is_same_block(
m1.template block<BlockRows,BlockCols>(1,1,BlockRows,BlockCols),
m1.block(1,1,fix<BlockRows>,fix<BlockCols>(BlockCols))));
133 i = internal::random<Index>(0,
rows-2);
155 VERIFY_IS_EQUAL( (
m1.block(
r1,
c1,
rows-
r1,
cols-
c1).block(
r2-
r1,
c2-
c1,
rows-
r2,
cols-
c2)) , (
m1.block(
r2,
c2,
rows-
r2,
cols-
c2)) );
162 VERIFY_IS_APPROX( ((
m1+
m2).
block(
r1,
c1,
rows-
r1,
cols-
c1).
block(
r2-
r1,
c2-
c1,
rows-
r2,
cols-
c2)) , ((
m1+
m2).
block(
r2,
c2,
rows-
r2,
cols-
c2)) );
185 DynamicMatrixType dm;
186 DynamicVectorType dv;
207 dm =
m1.row(
r1).segment(
c1,
c2-
c1+1).transpose();
243 template<
typename MatrixType>
249 Index innerStride =
m.innerStride();
250 Index outerStride =
m.outerStride();
251 Index rowStride =
m.rowStride();
252 Index colStride =
m.colStride();
259 if(!MatrixType::IsVectorAtCompileTime)
264 ?
i*outerStride +
j*innerStride
265 :
j*outerStride +
i*innerStride]);
268 if(MatrixType::IsVectorAtCompileTime)
270 VERIFY(innerStride ==
int((&
m.coeff(1))-(&
m.coeff(0))));
276 template<
typename MatrixType>
311 #ifndef EIGEN_DEFAULT_TO_ROW_MAJOR