class_Block.cpp File Reference

Go to the source code of this file.

Functions

int main (int, char **)
 
template<typename Derived >
const Eigen::Block< const Derived > topLeftCorner (const Eigen::MatrixBase< Derived > &m, int rows, int cols)
 
template<typename Derived >
Eigen::Block< Derived > topLeftCorner (Eigen::MatrixBase< Derived > &m, int rows, int cols)
 

Function Documentation

◆ main()

int main ( int  ,
char **   
)

Definition at line 18 of file class_Block.cpp.

19 {
21  std::cout << topLeftCorner(4*m, 2, 3) << std::endl; // calls the const version
22  topLeftCorner(m, 2, 3) *= 5; // calls the non-const version
23  std::cout << "Now the matrix m is:" << std::endl << m << std::endl;
24  return 0;
25 }
Matrix3f m
static const IdentityReturnType Identity()
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182
Eigen::Block< Derived > topLeftCorner(Eigen::MatrixBase< Derived > &m, int rows, int cols)
Definition: class_Block.cpp:6

◆ topLeftCorner() [1/2]

template<typename Derived >
const Eigen::Block<const Derived> topLeftCorner ( const Eigen::MatrixBase< Derived > &  m,
int  rows,
int  cols 
)

Definition at line 13 of file class_Block.cpp.

14 {
15  return Eigen::Block<const Derived>(m.derived(), 0, 0, rows, cols);
16 }
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:107

◆ topLeftCorner() [2/2]

template<typename Derived >
Eigen::Block<Derived> topLeftCorner ( Eigen::MatrixBase< Derived > &  m,
int  rows,
int  cols 
)

Definition at line 6 of file class_Block.cpp.

7 {
8  return Eigen::Block<Derived>(m.derived(), 0, 0, rows, cols);
9 }