class_FixedReshaped.cpp
Go to the documentation of this file.
1 #include <Eigen/Core>
2 #include <iostream>
3 using namespace Eigen;
4 using namespace std;
5 
6 template<typename Derived>
9 {
10  return Eigen::Reshaped<Derived, 4, 2>(m.derived());
11 }
12 
13 int main(int, char**)
14 {
15  MatrixXd m(2, 4);
16  m << 1, 2, 3, 4,
17  5, 6, 7, 8;
18  MatrixXd n = reshape_helper(m);
19  cout << "matrix m is:" << endl << m << endl;
20  cout << "matrix n is:" << endl << n << endl;
21  return 0;
22 }
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
reshape_helper
Eigen::Reshaped< Derived, 4, 2 > reshape_helper(MatrixBase< Derived > &m)
Definition: class_FixedReshaped.cpp:8
n
int n
Definition: BiCGSTAB_simple.cpp:1
m
Matrix3f m
Definition: AngleAxis_mimic_euler.cpp:1
main
int main(int, char **)
Definition: class_FixedReshaped.cpp:13
std
Definition: BFloat16.h:88
Eigen::MatrixBase
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
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