Tutorial_BlockOperations_block_assignment.cpp
Go to the documentation of this file.
1 #include <Eigen/Dense>
2 #include <iostream>
3 
4 int main()
5 {
7  m << 1,2,
8  3,4;
10  std::cout << "Here is the array a:\n" << a << "\n\n";
11  a.block<2,2>(1,1) = m;
12  std::cout << "Here is now a with m copied into its central 2x2 block:\n" << a << "\n\n";
13  a.block(0,0,2,3) = a.block(2,1,2,3);
14  std::cout << "Here is now a with bottom-right 2x3 block copied into top-left 2x3 block:\n" << a << "\n\n";
15 }
Matrix3f m
General-purpose arrays with easy API for coefficient-wise operations.
Definition: Array.h:49
static const ConstantReturnType Constant(Index rows, Index cols, const Scalar &value)