67 Scalar s1 = internal::random<Scalar>();
69 Index r1 = internal::random<Index>(0,
rows - 1);
70 Index r2 = internal::random<Index>(r1,
rows - 1);
71 Index c1 = internal::random<Index>(0,
cols - 1);
72 Index c2 = internal::random<Index>(c1,
cols - 1);
77 m1.row(r1).setConstant(s1);
80 m1.col(c1).setConstant(s1);
95 m1.row(r1) += s1 * m1_copy.row(r2);
98 m1.row(r1).row(0) += s1 * m1_copy.row(r2);
101 m1.col(c1) += s1 * m1_copy.col(c2);
103 m1.col(c1).col(0) += s1 * m1_copy.col(c2);
110 b1(0, 0) =
m1(r1, c1);
112 RowVectorType br1(
m1.block(r1, 0, 1,
cols));
118 m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1) = s1 *
m2.block(0, 0, r2 - r1 + 1, c2 - c1 + 1);
119 m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1)(r2 - r1, c2 - c1) =
m2.block(0, 0, r2 - r1 + 1, c2 - c1 + 1)(0, 0);
121 const Index BlockRows = 2;
122 const Index BlockCols = 5;
126 m1.template block<BlockRows, BlockCols>(1, 1) *= s1;
128 m1.template block<BlockRows, BlockCols>(1, 1)(0, 3) =
m1.template block<2, 5>(1, 1)(1, 2);
134 m1.template block<BlockRows, Dynamic>(1, 1, BlockRows, BlockCols) *= s1;
135 m1.template block<BlockRows, Dynamic>(1, 1, BlockRows, BlockCols)(0, 3) =
m1.template block<2, 5>(1, 1)(1, 2);
140 m1.block(3, 3, fix<Dynamic>(BlockRows), fix<Dynamic>(BlockCols))));
142 m1.block(1, 1, fix<BlockRows>, BlockCols)));
144 m1.block(1, 1, fix<BlockRows>(), fix<BlockCols>)));
146 m1.block(1, 1, fix<BlockRows>, fix<BlockCols>(BlockCols))));
160 i = internal::random<Index>(0,
rows - 2);
179 VERIFY_IS_EQUAL((
m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).row(0)), (
m1.row(r1).segment(c1, c2 - c1 + 1)));
180 VERIFY_IS_EQUAL((
m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).col(0)), (
m1.col(c1).segment(r1, r2 - r1 + 1)));
182 (
m1.row(r1).segment(c1, c2 - c1 + 1)).transpose());
184 (
m1.row(r1).segment(c1, c2 - c1 + 1)).transpose());
190 ((
m1 +
m2).
row(r1).segment(c1, c2 - c1 + 1)));
192 ((
m1 +
m2).
eval().
row(r1).segment(c1, c2 - c1 + 1)));
194 ((
m1 +
m2).
col(c1).segment(r1, r2 - r1 + 1)));
210 m1.col(c1).reverse().eval().segment(r1, r2 - r1 + 1).eval());
220 DynamicMatrixType dm;
221 DynamicVectorType dv;
223 dm =
m1.block(r1, c1,
rows - r1,
cols - c1).block(r2 - r1, c2 - c1,
rows - r2,
cols - c2);
227 dm =
m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).row(0).transpose();
228 dv =
m1.row(r1).segment(c1, c2 - c1 + 1);
232 dm =
m1.col(c1).segment(r1, r2 - r1 + 1);
233 dv =
m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).col(0);
237 dm =
m1.block(r1, c1, r2 - r1 + 1, c2 - c1 + 1).transpose().col(0);
238 dv =
m1.row(r1).segment(c1, c2 - c1 + 1);
242 dm =
m1.row(r1).segment(c1, c2 - c1 + 1).transpose();
243 dv =
m1.transpose().block(c1, r1, c2 - c1 + 1, r2 - r1 + 1).col(0);
int i
Definition: BiCGSTAB_step_by_step.cpp:9
MatrixXcf ones
Definition: ComplexEigenSolver_eigenvalues.cpp:1
M1<< 1, 2, 3, 4, 5, 6, 7, 8, 9;Map< RowVectorXf > v1(M1.data(), M1.size())
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
void adjoint(const MatrixType &m)
Definition: adjoint.cpp:85
Scalar * b
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:46
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
std::enable_if_t<!NumTraits< typename MatrixType::Scalar >::IsComplex, typename MatrixType::Scalar > block_real_only(const MatrixType &m1, Index r1, Index r2, Index c1, Index c2, const Scalar &s1)
Definition: block.cpp:13
void block(const MatrixType &m)
Definition: block.cpp:52
std::enable_if_t<((MatrixType::Flags &RowMajorBit)==0), void > check_left_top(const MatrixType &m, Index r, Index c, Index rows, Index)
Definition: block.cpp:40
std::enable_if_t< internal::is_same< T1, T2 >::value, bool > is_same_block(const T1 &a, const T2 &b)
Definition: block.cpp:35
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
float real
Definition: datatypes.h:10
#define VERIFY_IS_APPROX(a, b)
Definition: integer_types.cpp:13
int * m
Definition: level2_cplx_impl.h:294
#define VERIFY_IS_CWISE_EQUAL(a, b)
Definition: main.h:375
#define VERIFY(a)
Definition: main.h:362
#define VERIFY_IS_EQUAL(a, b)
Definition: main.h:367
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
void transpose()
Definition: skew_symmetric_matrix3.cpp:135
double Zero
Definition: pseudosolid_node_update_elements.cc:35
internal::nested_eval< T, 1 >::type eval(const T &xpr)
Definition: sparse_permutations.cpp:47
Definition: fft_test_shared.h:66