Eigen 3.4.90
doc
examples
Tutorial_BlockOperations_block_assignment.cpp
Go to the documentation of this file.
1
#include <
Eigen/Dense
>
2
#include <iostream>
3
4
int
main
()
5
{
6
Eigen::Array22f
m
;
7
m
<< 1,2,
8
3,4;
9
Eigen::Array44f
a
=
Eigen::Array44f::Constant
(0.6);
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
}
m
Matrix3f m
Definition:
AngleAxis_mimic_euler.cpp:1
a
ArrayXXi a
Definition:
Array_initializer_list_23_cxx11.cpp:1
Dense
main
int main()
Definition:
Tutorial_BlockOperations_block_assignment.cpp:4
Eigen::Array
General-purpose arrays with easy API for coefficient-wise operations.
Definition:
Array.h:49
Eigen::DenseBase::Constant
static const ConstantReturnType Constant(Index rows, Index cols, const Scalar &value)
Definition:
CwiseNullaryOp.h:191