OpenWalker Project
Documentation of the ROS Packages
matrix_ref.h
Go to the documentation of this file.
1 
34 #ifndef OPEN_WALKER_CORE_MATRIX_REF_H
35 #define OPEN_WALKER_CORE_MATRIX_REF_H
36 
37 #include <Eigen/Dense>
38 
39 namespace ow_core
40 {
50 template <typename _Derived, int _Rows, int _Cols>
51 class MatrixRef : public Eigen::Block<_Derived, _Rows, _Cols>
52 {
53 public:
54  typedef _Derived Derived;
55 
56  enum
57  {
58  Rows = _Rows,
59  Cols = _Cols,
60  };
61 
62  typedef Eigen::Block<Derived, Rows, Cols> Base;
63 
64 public:
78  explicit MatrixRef(Derived& ref, int startRow = 0, int startCol = 0) :
79  Base(ref, startRow, startCol)
80  {
81  }
82 
86  using Base::operator=;
87 
94  std::string toString() const
95  {
96  std::ostringstream out;
97  out << *this;
98  return out.str();
99  }
100 
101 private:
105  MatrixRef();
106 };
107 
108 } // namespace ow_core
109 
110 #endif // OPEN_WALKER_CORE_MATRIX_REF_H
Definition: angular_acceleration.h:39
MatrixRef(Derived &ref, int startRow=0, int startCol=0)
Default Constructor.
Definition: matrix_ref.h:78
std::string toString() const
Conversion to std::string.
Definition: matrix_ref.h:94
The MatrixRef class.
Definition: matrix_ref.h:51