class_Block.cpp File Reference
#include <Eigen/Core>
#include <iostream>

Functions

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

Function Documentation

◆ main()

int main ( int  ,
char **   
)
14  {
15  Eigen::Matrix4d m = Eigen::Matrix4d::Identity();
16  std::cout << topLeftCorner(4 * m, 2, 3) << std::endl; // calls the const version
17  topLeftCorner(m, 2, 3) *= 5; // calls the non-const version
18  std::cout << "Now the matrix m is:" << std::endl << m << std::endl;
19  return 0;
20 }
Eigen::Block< Derived > topLeftCorner(Eigen::MatrixBase< Derived > &m, int rows, int cols)
Definition: class_Block.cpp:5
int * m
Definition: level2_cplx_impl.h:294

References m, and topLeftCorner().

◆ topLeftCorner() [1/2]

template<typename Derived >
const Eigen::Block<const Derived> topLeftCorner ( const Eigen::MatrixBase< Derived > &  m,
int  rows,
int  cols 
)
10  {
11  return Eigen::Block<const Derived>(m.derived(), 0, 0, rows, cols);
12 }
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:110

References cols, m, and rows.

◆ topLeftCorner() [2/2]

template<typename Derived >
Eigen::Block<Derived> topLeftCorner ( Eigen::MatrixBase< Derived > &  m,
int  rows,
int  cols 
)
5  {
6  return Eigen::Block<Derived>(m.derived(), 0, 0, rows, cols);
7 }

References cols, m, and rows.

Referenced by corners(), and main().