(Event+Time).Variant Operators  2.3
Operators for Timed Discrete Event Systems in Dioids
Fper.h
Go to the documentation of this file.
1 #ifndef FPER_H
2 #define FPER_H
3 #include<utility>
4 #include<vector>
5 #include<string>
15 namespace etvo
16 {
17 
25 class Fper
26 {
27  public:
31  Fper();
38  Fper(int dP,int codP,const std::vector<int> & seq);
39 
44  void setSeq(const std::vector<int> & seq);
45 
51  void setPeriodicity(int dP,int codP);
52 
55  std::pair<int, int> getPeriodicity() const;
56 
62  int getValue(int arg) const;
63 
69  int operator()(int arg) const;
70 
72  int getDomPer() const;
74  int getCodomPer() const;
75 
76  bool operator==(const Fper & f) const;
77  bool operator!=(const Fper & f) const;
78  bool operator<=(const Fper & f) const;
79  bool operator>=(const Fper & f) const;
80 
81 
85  Fper extendBy(unsigned mul) const;
86 
91  Fper composeWith(const Fper & f) const;
92 
93  Fper sum(const Fper & f) const;
94 
98  void reduce();
99 
100  void canon();
101 
105  double getyMax0() const;
108  double getyMin0() const;
109 
113  virtual std::string toString() const;
114 
116  static void setAutoReduction(bool on);
118  static bool getAutoReductionState();
119 
120  protected:
121  bool reduceBy(unsigned div);
123  static bool _autoreduction;
124 
125  void updateYMinMax();
126  bool isNodecreasing(const std::vector<int> & v);
127 
129  int _domP;
131  int _codomP;
133  std::vector<int> _seq;
134 
135  double _yMax0;
136  double _yMin0;
137 };
138 
142  std::ostream & operator<<(std::ostream & f,const Fper & );
143 }
144 #endif // FPER_H
int _codomP
codomain period
Definition: Fper.h:131
void setSeq(const std::vector< int > &seq)
Set values of f(0),f(1), ... over one period.
Definition: Fper.cpp:44
Fper extendBy(unsigned mul) const
Produces a non-canonical extension of a (dP,codP) pseudo-periodic function The result is the equivale...
Definition: Fper.cpp:151
Fper()
Default constructor : set as Id function Z->Z,x->x.
Definition: Fper.cpp:22
static void setAutoReduction(bool on)
Class method (called by Fper::setAutoReductionState(b)) to set the autoreduction state (ON/OFF) ...
Definition: Fper.cpp:260
Fper composeWith(const Fper &f) const
Computes the composition of *this with f.
Definition: Fper.cpp:175
std::ostream & operator<<(std::ostream &f, const dDd &m)
Definition: dDd.cpp:313
Definition: etvoException.cpp:5
virtual std::string toString() const
Definition: Fper.cpp:248
int getValue(int arg) const
Value of f(x)
Definition: Fper.cpp:74
double getyMax0() const
Definition: Fper.cpp:238
std::vector< int > _seq
periodic sequence
Definition: Fper.h:133
int getDomPer() const
Definition: Fper.cpp:96
static bool _autoreduction
class variable to set ON/OFF the autoreduction
Definition: Fper.h:123
int getCodomPer() const
Definition: Fper.cpp:101
Base class for pseudo - periodic functions Z->Z where f(x + dP) = codP + f(x)
Definition: Fper.h:25
int _domP
domain period
Definition: Fper.h:129
void setPeriodicity(int dP, int codP)
Set dP/codP.
Definition: Fper.cpp:54
double getyMin0() const
Definition: Fper.cpp:243
std::pair< int, int > getPeriodicity() const
returns the pair (dP,codP)
Definition: Fper.cpp:69
void reduce()
Reduces a non-canonical pseudo-periodic function to the canonical form which has the least period (dP...
Definition: Fper.cpp:204
static bool getAutoReductionState()
Class method (called by Fper::getAutoReductionState()) to obtain the autoreduction state (ON/OFF) ...
Definition: Fper.cpp:265
int operator()(int arg) const
Value of f(x)
Definition: Fper.cpp:91