(Event+Time).Variant Operators  2.3
Operators for Timed Discrete Event Systems in Dioids
seriesTg.h
1 #ifndef SERIESTG_H
2 #define SERIESTG_H
3 #include "polyTg.h"
4 #include "../wrapperMMGD/seriesWrapper.h"
5 #include "../wrapperMMGD/matrixWrapper.h"
6 #include<iostream>
7 #include "../common/ISterm.h"
8 
9 
15 namespace etvo
16 {
25  class seriesTg:public ISterm
26  {
27  private:
28  bool _droite; // true if right-form
29  polyTg _p; // _p polynomial
30  polyTg _q; // _q polynomial
31  long _gamma; // exponent of gn in p+q.[gn.dtr]* or in p+[gn.dt]*.q
32  long _deltaL; // exponent of dt in p+[gn.dtl]*.q
33  long _deltaR; // exponent of dt in p+q.[gn.dtr]*
34 
35  // internal usefull functions to simplify series in right-form
36  void reductionPeriodicR();
37  void toProperFormR();
38  void toProperPeriodicR();
39  void toProperTransientR();
40  void reductionTransientR();
41 
42  // internal usefull functions to simplify series in left-form
43  void reductionPeriodicL();
44  void toProperFormL();
45  void toProperPeriodicL();
46  void toProperTransientL();
47  void reductionTransientL();
48  void rightLeft();
49  void degenerateCase();
50 
51  // internal usefull functions to compute the domination point for sums
52  static long getDominationEventLH(const seriesTg & slow, const seriesTg & fast);
53  // static seriesTg star(const etvo::series & s, unsigned nablaM, int gK);
54 
55  // internal usefull function to compute a part of the coreToSeriesTg function
56  static seriesTg coreEntryToSeriesTg(int i, int j, int mb, const series & s);
57 
58  public:
60  static seriesTg Epsilon();
62  static seriesTg Top();
64  static seriesTg E();
65 
67  seriesTg();
68 
72  seriesTg(bool TopNotE);
73 
75  seriesTg(const Tg & m);
76 
78  seriesTg(const polyTg & q);
79 
83  seriesTg(const polyTg & p,const polyTg & q, long n, long t, bool right = true);
87  seriesTg(const polyTg & p, const polyTg & q, const gd & r,bool right = 1);
88 
90  bool isRightForm() const;
92  bool isLeftForm() const;
94  bool isPolynomial() const;
96  bool isProper() const;
98  bool isE() const;
100  void canon();
101 
103  void toRight();
104 
106  void toLeft();
108  polyTg getP() const;
110  polyTg getQ() const;
112  gd getR() const;
113 
116  std::string toString() const;
119  std::string toStringAsDeltaVar() const;
120 
122  bool operator==(const seriesTg & s) const;
124  bool operator!=(const seriesTg &)const;
126  bool operator<=(const seriesTg &) const;
128  bool operator>=(const seriesTg &) const;
129 
131  static polyTg getPolyUpTo(int gammaN, const polyTg & p, const polyTg & q, const gd & r, bool droite = true);
132 
134  void getLcmGain(unsigned int & vee, unsigned int& wedge) const;
136  void getMaxGain(unsigned int& vee, unsigned int& wedge) const;
138  std::pair<unsigned int, unsigned int> getMaxGain() const;
139 
141  seriesTg operator+(const seriesTg & s) const;
143  seriesTg oplus(const seriesTg & s) const;
145  seriesTg oplus(const polyTg & p) const;
146 
148  seriesTg otimes(const seriesTg & s) const;
149 
151  static seriesTg otimes(const Tg & m, const seriesTg & s);
153  static seriesTg otimes(const polyTg & m, const seriesTg & s);
154 
156  seriesTg operator*(const seriesTg & s) const;
158  seriesTg operator*(const Tg & m) const;
160  seriesTg operator*(const polyTg & p) const;
161 
163  seriesTg otimes(const Tg & m) const;
165  seriesTg otimes(const polyTg & p) const;
166 
168  static seriesTg oplus(const polyTg & p, const seriesTg & s);
169 
171  static seriesTg toSeriesTg(const series & s);
172 
175  etvo::matrix<series> getCore(unsigned ratio = 1) const;
178  etvo::matrix<series> getCoreMax(unsigned ratio = 1) const;
179 
180  static etvo::matrix<series> getMatN(unsigned size);
183  seriesTg starCD() const;
187  seriesTg star() const;
188 
190  static seriesTg coreToSeriesTg(const matrix<series> & C);
191 
193  seriesTg otimesCD(const seriesTg & s) const;
195  seriesTg oplusCD(const seriesTg & s) const;
196 
198  seriesTg infCD(const seriesTg & s) const;
200  seriesTg inf(const seriesTg & s) const;
202  seriesTg lfracCD(const seriesTg & s) const;
204  seriesTg rfracCD(const seriesTg & s) const;
206  seriesTg lfrac(const seriesTg & s) const;
208  seriesTg rfrac(const seriesTg & s) const;
209 
211  polyTg getPolyUpTo(int gammaN) const;
212 
214  static seriesTg toCausal(const seriesTg & s);
215 
217  std::vector<series> toImpulseResponse() const;
218 
220  series toSeries() const;
221 
222  /*
224  bool operator<=(const seriesEd &) const;
226  bool operator>=(const seriesEd &) const;
227  */
228  };
229 
230  std::ostream & operator<<(std::ostream & f, const seriesTg & s);
231 
232 
233  // necessary for matrix<T> computations.
234  seriesTg star(const seriesTg & s);
235  seriesTg oplus(const seriesTg &, const seriesTg &);
236  seriesTg inf(const seriesTg &, const seriesTg &);
237  seriesTg otimes(const seriesTg &, const seriesTg &);
238  seriesTg lfrac(const seriesTg &, const seriesTg &);
239  seriesTg rfrac(const seriesTg &, const seriesTg &);
240 
242  seriesTg tg(int n);
244  seriesTg td(int t);
246  seriesTg tD(unsigned n);
248  seriesTg td(const std::vector<int> & seqDelays);
250  seriesTg tv(unsigned v);
252  seriesTg tw(unsigned w);
253 } // end namespace etvo
254 
255 #endif // SERIESED_H
bool isProper() const
check if it is in proper form
Definition: seriesTg.cpp:327
etvo::matrix< series > getCore(unsigned ratio=1) const
Definition: seriesTg.cpp:1119
bool operator>=(const seriesTg &) const
check order on series
Definition: seriesTg.cpp:1591
void toRight()
to Right form
Definition: seriesTg.cpp:271
std::vector< series > toImpulseResponse() const
returns the response to I,g1.I,g2.I ...
Definition: seriesTg.cpp:1534
polyTg getP() const
getter returning p
Definition: seriesTg.cpp:233
bool operator!=(const seriesTg &) const
check difference
Definition: seriesTg.cpp:732
void toLeft()
to Left form
Definition: seriesTg.cpp:276
seriesTg td(int t)
element d^t in T[[g]]
Definition: seriesTg.cpp:15
seriesTg tv(unsigned v)
element V_v in T[[g]] (time multiplier)
Definition: seriesTg.cpp:17
Class for ultimately-periodic series in the semiring T[[g]].
Definition: seriesTg.h:25
seriesTg tw(unsigned w)
element W_w in T[[g]] (time divisor)
Definition: seriesTg.cpp:18
seriesTg operator*(const seriesTg &s) const
product of series in T[[g]] : s1*s2
Definition: seriesTg.cpp:1027
Class for monomials in the semiring T[[g]].
Definition: Tg.h:22
std::ostream & operator<<(std::ostream &f, const dDd &m)
Definition: dDd.cpp:313
static seriesTg Top()
The Top description of seriesTg.
Definition: seriesTg.cpp:119
Definition: matrixWrapper.h:33
Definition: etvoException.cpp:5
seriesTg rfrac(const seriesTg &s) const
right-product residuation : s1.rfrac(s2) = s1/s2
Definition: seriesTg.cpp:1429
etvo::matrix< series > getCoreMax(unsigned ratio=1) const
Definition: seriesTg.cpp:1252
bool isPolynomial() const
check if it is a polynomial
Definition: seriesTg.cpp:129
std::string toStringAsDeltaVar() const
Definition: seriesTg.cpp:54
static seriesTg Epsilon()
The epsilon description of seriesTg.
Definition: seriesTg.cpp:114
static seriesTg E()
The description of g0.d0 as seriesTg.
Definition: seriesTg.cpp:124
seriesTg rfracCD(const seriesTg &s) const
operations via Core Decomposition : rfrac
Definition: seriesTg.cpp:1409
series toSeries() const
projection seriesTg->series (zero slice)
Definition: seriesTg.cpp:1518
static seriesTg toCausal(const seriesTg &s)
returns the projection of s into the set of causal series in T[[g]] (not reliable yet) ...
Definition: seriesTg.cpp:1444
seriesTg()
Default initialization : epsilon (p=eps q=eps r=g1.d0)
Definition: seriesTg.cpp:163
seriesTg inf(const seriesTg &s) const
inf of series
Definition: seriesTg.cpp:1389
seriesTg lfracCD(const seriesTg &s) const
operations via Core Decomposition : lfrac
Definition: seriesTg.cpp:1394
Wrapper class to mmgd::serie from MinMaxGD library.
Definition: seriesWrapper.h:37
seriesTg lfrac(const seriesTg &s) const
left-product residuation : s1.lfrac(s2) = s2
Definition: seriesTg.cpp:1424
seriesTg oplus(const seriesTg &s) const
sum of series in T[[g]] : s1.oplus(s2)
Definition: seriesTg.cpp:830
static seriesTg coreToSeriesTg(const matrix< series > &C)
[static] conversion CORE decomposition -> seriesEd
Definition: seriesTg.cpp:1297
std::pair< unsigned int, unsigned int > getMaxGain() const
returns the gain as a pair (mu,beta)
Definition: seriesTg.cpp:605
static polyTg getPolyUpTo(int gammaN, const polyTg &p, const polyTg &q, const gd &r, bool droite=true)
static function to develop the first terms of p+q.[r]* or p+[r]*.q up to a given gammaN value ...
Definition: seriesTg.cpp:656
seriesTg operator+(const seriesTg &s) const
sum of series in T[[g]] : s1+s2 (calls oplus)
Definition: seriesTg.cpp:820
bool isLeftForm() const
check if the current series in Left form
Definition: seriesTg.cpp:254
seriesTg otimes(const seriesTg &s) const
product of series in T[[g]] : s1.otimes(s2)
Definition: seriesTg.cpp:975
seriesTg infCD(const seriesTg &s) const
operations via Core Decomposition : inf
Definition: seriesTg.cpp:1369
gd getR() const
getter returning r
Definition: seriesTg.cpp:243
seriesTg star() const
Definition: seriesTg.cpp:1245
polyTg getQ() const
getter returning q
Definition: seriesTg.cpp:238
seriesTg tD(unsigned w)
element Delta_n T[[g]]
Definition: seriesTg.cpp:16
void canon()
leads to the canonical left or right form (the simplest proper form)
Definition: seriesTg.cpp:358
static seriesTg toSeriesTg(const series &s)
injection series(mmgd)->seriesEd
Definition: seriesTg.cpp:1034
Wrapper class to mmgd::gd from MinMaxGD library.
Definition: gdWrapper.h:36
seriesTg otimesCD(const seriesTg &s) const
operations via Core Decomposition : otimes
Definition: seriesTg.cpp:1349
bool operator<=(const seriesTg &) const
check order on series
Definition: seriesTg.cpp:1549
seriesTg oplusCD(const seriesTg &s) const
operations via Core Decomposition : oplus
Definition: seriesTg.cpp:1329
void getLcmGain(unsigned int &vee, unsigned int &wedge) const
returns the Least Common multiple of gains in the terms of the current series
Definition: seriesTg.cpp:633
Abstract base class to handle Idempotent Semiring terms.
Definition: ISterm.h:27
seriesTg starCD() const
Definition: seriesTg.cpp:1228
bool operator==(const seriesTg &s) const
check equality
Definition: seriesTg.cpp:717
Class for polynomials in the semiring T[[g]].
Definition: polyTg.h:23
seriesTg tg(int n)
element g^n in T[[g]]
Definition: seriesTg.cpp:14
bool isRightForm() const
check if the current series in Right form
Definition: seriesTg.cpp:249
bool isE() const
check if it is a neutral seriesEd
Definition: seriesTg.cpp:134
std::string toString() const
Definition: seriesTg.cpp:81