- 3.0.2 core module.
ControlVector.h
Go to the documentation of this file.
1 /**********************************************************************************************************************
2 This file is part of the Control Toolbox (https://github.com/ethz-adrl/control-toolbox), copyright by ETH Zurich.
3 Licensed under the BSD-2 license (see LICENSE file in main directory)
4 **********************************************************************************************************************/
5 
6 #pragma once
7 
8 namespace ct {
9 namespace core {
10 
11 template <int CONTROL_DIM, class SCALAR = double>
12 class ControlVector : public Eigen::Matrix<SCALAR, CONTROL_DIM, 1>
13 {
14 public:
15  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
16 
17  static const size_t DIM = CONTROL_DIM;
18 
20  virtual ~ControlVector(){};
21 
22  typedef Eigen::Matrix<SCALAR, CONTROL_DIM, 1> Base;
23 
25  template <typename OtherDerived>
26  ControlVector(const Eigen::MatrixBase<OtherDerived>& other) : Base(other)
27  {
28  }
29 
31  template <typename OtherDerived>
32  ControlVector& operator=(const Eigen::MatrixBase<OtherDerived>& other)
33  {
34  this->Base::operator=(other);
35  return *this;
36  }
37 
39  Base& toImplementation() { return *this; }
41  const Base& toImplementation() const { return *this; }
42 };
43 
44 } /* namespace core */
45 } /* namespace ct */
Definition: ControlVector.h:12
ControlVector & operator=(const Eigen::MatrixBase< OtherDerived > &other)
This method allows you to assign Eigen expressions to MyVectorType.
Definition: ControlVector.h:32
const Base & toImplementation() const
get const underlying Eigen type
Definition: ControlVector.h:41
static EIGEN_MAKE_ALIGNED_OPERATOR_NEW const size_t DIM
Definition: ControlVector.h:17
virtual ~ControlVector()
Definition: ControlVector.h:20
Base & toImplementation()
get underlying Eigen type
Definition: ControlVector.h:39
ControlVector()
Definition: ControlVector.h:19
Eigen::Matrix< SCALAR, CONTROL_DIM, 1 > Base
Definition: ControlVector.h:20
ControlVector(const Eigen::MatrixBase< OtherDerived > &other)
This constructor allows you to construct MyVectorType from Eigen expressions.
Definition: ControlVector.h:26