codac  1.5.7
codac_DynCtc.h
Go to the documentation of this file.
1 
12 #ifndef __CODAC_DYNCTC_H__
13 #define __CODAC_DYNCTC_H__
14 
15 #include "codac_Tube.h"
16 #include "codac_TubeVector.h"
17 
18 namespace codac
19 {
20  class Domain;
21 
26  enum class TimePropag
27  {
28  FORWARD = 0x01,
29  BACKWARD = 0x02
30  };
31 
41  inline int operator&(TimePropag a, TimePropag b)
42  { return static_cast<int>(static_cast<int>(a) & static_cast<int>(b)); }
43 
54  { return static_cast<TimePropag>(static_cast<int>(a) | static_cast<int>(b)); }
55 
60  class DynCtc
61  {
62  public:
63 
69  DynCtc(bool intertemporal = true); // todo: remove default value
70 
74  virtual ~DynCtc();
75 
76  /*
77  * \brief Contracts a set of abstract domains
78  *
79  * This method has to be overridden in order to make the contractor
80  * available in the CN framework.
81  *
82  * \param v_domains vector of Domain pointers
83  */
84  virtual void contract(std::vector<Domain*>& v_domains) = 0;
85 
91  void preserve_slicing(bool preserve = true);
92 
100  void set_fast_mode(bool fast_mode = true);
101 
107  void restrict_tdomain(const Interval& tdomain);
108 
114  bool is_intertemporal() const;
115 
116  protected:
117 
118  bool m_preserve_slicing = true;
119  bool m_fast_mode = false;
121  const bool m_intertemporal = true;
122  };
123 }
124 
125 #endif
Contractor interface.
Definition: codac_DynCtc.h:61
void preserve_slicing(bool preserve=true)
Specifies whether the contractor can impact the tube's slicing or not.
void restrict_tdomain(const Interval &tdomain)
Limits the temporal domain of contractions.
const bool m_intertemporal
defines if the related constraint is inter-temporal or not (true by default)
Definition: codac_DynCtc.h:121
DynCtc(bool intertemporal=true)
Creates a contractor.
Interval m_restricted_tdomain
limits the contractions to the specified temporal domain
Definition: codac_DynCtc.h:120
bool m_preserve_slicing
if true, tube's slicing will not be affected by the contractor
Definition: codac_DynCtc.h:118
bool m_fast_mode
some contractors may propose more pessimistic but faster execution modes
Definition: codac_DynCtc.h:119
virtual ~DynCtc()
DynCtc destructor.
bool is_intertemporal() const
Tests if the related constraint is inter-temporal or not.
void set_fast_mode(bool fast_mode=true)
Specifies an optional fast mode of contraction.
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition: codac_capd_helpers.h:9
const IntervalMatrix operator&(const IntervalMatrix &x, const IntervalMatrix &y)
TimePropag
Specifies the temporal propagation way (forward or backward in time)
Definition: codac_DynCtc.h:27
@ BACKWARD
backward in time (from to )
@ FORWARD
forward in time (from to )
const IntervalMatrix operator|(const IntervalMatrix &x, const IntervalMatrix &y)