class_Reshaped.cpp
Go to the documentation of this file.
1 #include <Eigen/Core>
2 #include <iostream>
3 
4 template<typename Derived>
7 {
8  return Eigen::Reshaped<const Derived>(m.derived(), rows, cols);
9 }
10 
11 int main(int, char**)
12 {
13  Eigen::MatrixXd m(3, 4);
14  m << 1, 4, 7, 10,
15  2, 5, 8, 11,
16  3, 6, 9, 12;
17  std::cout << m << std::endl;
19  std::cout << "Matrix m is:" << std::endl << m << std::endl;
20  std::cout << "Matrix n is:" << std::endl << n << std::endl;
21 }
Matrix3f m
int n
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182
A matrix or vector expression mapping an existing expression.
Definition: Ref.h:285
Expression of a fixed-size or dynamic-size reshape.
Definition: Reshaped.h:99
int main(int, char **)
const Eigen::Reshaped< const Derived > reshape_helper(const Eigen::MatrixBase< Derived > &m, int rows, int cols)