- 3.0.2 core module.
OutputVector.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 <size_t OUTPUT_DIM, class SCALAR = double>
12 class OutputVector : public Eigen::Matrix<SCALAR, OUTPUT_DIM, 1>
13 {
14 public:
15  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
16 
17  typedef Eigen::Matrix<SCALAR, OUTPUT_DIM, 1> Base;
18  static const size_t DIM = OUTPUT_DIM;
19 
21  virtual ~OutputVector() {}
23  template <typename OtherDerived>
24  OutputVector(const Eigen::MatrixBase<OtherDerived>& other) : Base(other)
25  {
26  }
27 
29  template <typename OtherDerived>
30  OutputVector& operator=(const Eigen::MatrixBase<OtherDerived>& other)
31  {
32  this->Base::operator=(other);
33  return *this;
34  }
35 
37  Base& toImplementation() { return *this; }
39  const Base& toImplementation() const { return *this; }
40 };
41 
42 } /* namespace core */
43 } /* namespace ct */
OutputVector()
Definition: OutputVector.h:20
OutputVector & operator=(const Eigen::MatrixBase< OtherDerived > &other)
This method allows you to assign Eigen expressions to MyVectorType.
Definition: OutputVector.h:30
Base & toImplementation()
get underlying Eigen type
Definition: OutputVector.h:37
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef Eigen::Matrix< SCALAR, OUTPUT_DIM, 1 > Base
Definition: OutputVector.h:17
static const size_t DIM
Definition: OutputVector.h:18
OutputVector(const Eigen::MatrixBase< OtherDerived > &other)
This constructor allows you to construct MyVectorType from Eigen expressions.
Definition: OutputVector.h:24
Definition: OutputVector.h:12
const Base & toImplementation() const
get const underlying Eigen type
Definition: OutputVector.h:39
virtual ~OutputVector()
Definition: OutputVector.h:21