OpenWalker Project
Documentation of the ROS Packages
vector_ref.h
Go to the documentation of this file.
1 
34 #ifndef OPEN_WALKER_CORE_VECTOR_REF_H
35 #define OPEN_WALKER_CORE_VECTOR_REF_H
36 
37 #include <Eigen/Dense>
38 
39 namespace ow_core
40 {
50 template <typename _Derived, int _Rows>
51 class VectorRef : public Eigen::Block<_Derived, _Rows, 1>
52 {
53 public:
54  typedef _Derived Derived;
55 
56  enum
57  {
58  Rows = _Rows
59  };
60 
61  typedef Eigen::Block<Derived, Rows, 1> Base;
62 
63 public:
77  explicit VectorRef(Derived& ref, int startRow = 0, int startCol = 0) : Base(ref, startRow, startCol)
78  {
79  }
80 
84  using Base::operator=;
85 
89  std::string toString() const
90  {
91  std::ostringstream out;
92  out << this->transpose();
93  return out.str();
94  }
95 
96 private:
100  VectorRef();
101 };
102 
103 } // namespace ow_core
104 
105 #endif // OPEN_WALKER_CORE_VECTOR_REF_H
The VectorRef class.
Definition: vector_ref.h:51
std::string toString() const
Conversion to std::string.
Definition: vector_ref.h:89
Definition: angular_acceleration.h:39
VectorRef(Derived &ref, int startRow=0, int startCol=0)
Default Constructor.
Definition: vector_ref.h:77