gtsam
3rdparty
Eigen
doc
examples
class_Reshaped.cpp
Go to the documentation of this file.
1
#include <Eigen/Core>
2
#include <iostream>
3
using namespace
std
;
4
using namespace
Eigen
;
5
6
template
<
typename
Derived>
7
const
Reshaped<const Derived>
8
reshape_helper
(
const
MatrixBase<Derived>
&
m
,
int
rows
,
int
cols
)
9
{
10
return
Reshaped<const Derived>
(
m
.derived(),
rows
,
cols
);
11
}
12
13
int
main
(
int
,
char
**)
14
{
15
MatrixXd
m
(3, 4);
16
m
<< 1, 4, 7, 10,
17
2, 5, 8, 11,
18
3, 6, 9, 12;
19
cout <<
m
<< endl;
20
Ref<const MatrixXd>
n
=
reshape_helper
(
m
, 2, 6);
21
cout <<
"Matrix m is:"
<< endl <<
m
<< endl;
22
cout <<
"Matrix n is:"
<< endl <<
n
<< endl;
23
}
Eigen
Namespace containing all symbols from the Eigen library.
Definition:
jet.h:637
rows
int rows
Definition:
Tutorial_commainit_02.cpp:1
n
int n
Definition:
BiCGSTAB_simple.cpp:1
reshape_helper
const Reshaped< const Derived > reshape_helper(const MatrixBase< Derived > &m, int rows, int cols)
Definition:
class_Reshaped.cpp:8
main
int main(int, char **)
Definition:
class_Reshaped.cpp:13
m
Matrix3f m
Definition:
AngleAxis_mimic_euler.cpp:1
Eigen::Ref
A matrix or vector expression mapping an existing expression.
Definition:
Ref.h:281
std
Definition:
BFloat16.h:88
Eigen::MatrixBase
Base class for all dense matrices, vectors, and expressions.
Definition:
MatrixBase.h:48
cols
int cols
Definition:
Tutorial_commainit_02.cpp:1
Eigen::Reshaped
Expression of a fixed-size or dynamic-size reshape.
Definition:
Reshaped.h:96
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:15