ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
integratorchain.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2017-2020 German Aerospace Center (DLR).
3  * Eclipse ADORe, Automated Driving Open Research https://eclipse.org/adore
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License 2.0 which is available at
7  * http://www.eclipse.org/legal/epl-2.0.
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  * Daniel Heß - initial API and implementation
13  ********************************************************************************/
14 
15 #pragma once
16 
17 #include <adore/mad/alfunction.h>
18 
19 namespace adore
20 {
21  namespace mad
22  {
31  template<typename T, int depth>
32  class IntegratorChain :public ALFunction<T, T>
33  {
34  private:
35  int m_level;
37  typedef T DT;
38  typedef T CT;
39  public:
41  {
42  m_data = data;
43  m_level = level;
44  }
46  {
47  delete m_data;
48  }
49  public:
50  //return m_level entry in data function
51  virtual CT f(DT x) const override
52  {
53  if (m_level < depth)
54  {
55  return m_data->fi(x, m_level);
56  }
57  else
58  {
59  return (T)0;
60  }
61  }
62  virtual DT limitHi() const override { return m_data->limitHi(); }
63  virtual DT limitLo() const override { return m_data->limitLo(); }
64  virtual void invertDirection()override { m_data->invertDirection(); }
65  virtual void setLimits(DT lo, DT hi)override { m_data->setLimits(lo, hi); }
68  virtual void bound(const DT& xmin, const DT& xmax, CT& ymin, CT& ymax)override
69  {
70  if (m_level < depth)
71  {
72  m_data->dimension(m_level)->bound(xmin, xmax, ymin, ymax);
73  }
74  else
75  {
76  ymin = 0;
77  ymax = 0;
78  }
79  }
80  };
81  }
82 }
Definition: alfunction.h:74
virtual void bound(const DT &xmin, const DT &xmax, CT &ymin, CT &ymax)=0
virtual ALFunction< DT, CT > * clone()=0
virtual DT limitHi() const =0
virtual DT limitLo() const =0
virtual void setLimits(DT lo, DT hi)=0
virtual SUBFUN * dimension(int i)=0
virtual T fi(DT x, int dim) const =0
Definition: integratorchain.h:33
T CT
Definition: integratorchain.h:38
virtual DT limitLo() const override
Definition: integratorchain.h:63
T DT
Definition: integratorchain.h:37
virtual void invertDirection() override
Definition: integratorchain.h:64
virtual void bound(const DT &xmin, const DT &xmax, CT &ymin, CT &ymax) override
Definition: integratorchain.h:68
AScalarToN< T, depth > * m_data
Definition: integratorchain.h:36
virtual DT limitHi() const override
Definition: integratorchain.h:62
~IntegratorChain()
Definition: integratorchain.h:45
int m_level
Definition: integratorchain.h:35
virtual ALFunction< DT, CT > * create_derivative() override
Definition: integratorchain.h:67
virtual void setLimits(DT lo, DT hi) override
Definition: integratorchain.h:65
virtual ALFunction< DT, CT > * clone() override
Definition: integratorchain.h:66
virtual CT f(DT x) const override
Definition: integratorchain.h:51
IntegratorChain(AScalarToN< T, depth > *data, int level)
Definition: integratorchain.h:40
x
Definition: adore_set_goal.py:30
Definition: areaofeffectconverter.h:20