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

Functions

template<typename Derived >
Eigen::Block< Derived, 2, 2 > topLeft2x2Corner (Eigen::MatrixBase< Derived > &m)
 
template<typename Derived >
const Eigen::Block< const Derived, 2, 2 > topLeft2x2Corner (const Eigen::MatrixBase< Derived > &m)
 
int main (int, char **)
 

Function Documentation

◆ main()

int main ( int  ,
char **   
)
14  {
15  Eigen::Matrix3d m = Eigen::Matrix3d::Identity();
16  std::cout << topLeft2x2Corner(4 * m) << std::endl; // calls the const version
17  topLeft2x2Corner(m) *= 2; // 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, 2, 2 > topLeft2x2Corner(Eigen::MatrixBase< Derived > &m)
Definition: class_FixedBlock.cpp:5
int * m
Definition: level2_cplx_impl.h:294

References m, and topLeft2x2Corner().

◆ topLeft2x2Corner() [1/2]

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

References m.

◆ topLeft2x2Corner() [2/2]

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

References m.

Referenced by main().