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