Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 3 of file tutorial.cpp.
5 std::cout.precision(2);
11 std::cout <<
"*** Step 1 ***\nm3:\n" << m3 <<
"\nm4:\n" << m4 << std::endl;
17 std::cout <<
"*** Step 2 ***\nm3:\n" << m3 <<
"\nm4:\n" << m4 << std::endl;
20 m4.block<3,3>(0,1) = m3;
21 m3.row(2) = m4.block<1,3>(2,0);
23 std::cout <<
"*** Step 3 ***\nm3:\n" << m3 <<
"\nm4:\n" << m4 << std::endl;
29 std::cout <<
"*** Step 4 ***\nm4:\n" << m4 << std::endl;
34 std::cout <<
"*** Step 5 ***\nm4.diagonal():\n" << m4.
diagonal() << std::endl;
35 std::cout <<
"m4.diagonal().start(3)\n" << m4.
diagonal().start(3) << std::endl;
39 m3 = m3.cwise().
cos();
40 std::cout <<
"*** Step 6 ***\nm3:\n" << m3 <<
"\nm4:\n" << m4 << std::endl;
43 std::cout <<
"*** Step 7 ***\n m4.sum(): " << m4.
sum() << std::endl;
44 std::cout <<
"m4.col(2).sum(): " << m4.col(2).
sum() << std::endl;
45 std::cout <<
"m4.colwise().sum():\n" << m4.
colwise().
sum() << std::endl;
46 std::cout <<
"m4.rowwise().sum():\n" << m4.
rowwise().
sum() << std::endl;
52 m4 = -m4 + m4 + 5 * m4;
55 m3 = m3 * m4.block<3,3>(1,1);
59 m4 = m4 * m4.transpose().eval();
61 std::cout <<
"*** Step 8 ***\nm3:\n" << m3 <<
"\nm4:\n" << m4 << std::endl;
TransposeReturnType transpose()
ConstColwiseReturnType colwise() const
ConstRowwiseReturnType rowwise() const
static const RandomReturnType Random()
DiagonalReturnType diagonal()
const MatrixFunctionReturnValue< Derived > cos() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise cosine...
static const IdentityReturnType Identity()
The matrix class, also used for vectors and row-vectors.
Derived & setZero(Index size)
const SumReturnType sum() const