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 }
Matrix3f m
int n
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Definition: BFloat16.h:88
int main(int, char **)
Expression of a fixed-size or dynamic-size reshape.
Definition: Reshaped.h:96
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
Eigen::Reshaped< Derived, 4, 2 > reshape_helper(MatrixBase< Derived > &m)


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:01