(Event+Time).Variant Operators  2.3
Operators for Timed Discrete Event Systems in Dioids
seriesET.h
Go to the documentation of this file.
1 #ifndef SERIESET_H
2 #define SERIESET_H
3 #include "../wrapperMMGD/seriesWrapper.h"
4 #include "../wrapperMMGD/matrixWrapper.h"
5 #include "../seriesEd/seriesEd.h"
6 #include "../seriesTg/seriesTg.h"
7 #include<iostream>
8 #include "../common/ISterm.h"
9 
10 
15 namespace etvo
16 {
25  class seriesET:public ISterm
26  {
27  private:
28  bool _QEdForm; // true if Q in E[[d]] //false if Q in T[[g]]
29  matrix<dDd> _Led;
30  matrix<seriesEd> _Qed; // if _QEdForm -> Led.Qed.Red
31  matrix<dDd> _Red;
32  matrix<gNg> _Ltg;
33  matrix<seriesTg> _Qtg; // if !_QEdForm -> Ltg.Qtg.Rtg
34  matrix<gNg> _Rtg;
35  // internal usefull functions
36  seriesET(const matrix<dDd> & Led, const matrix<seriesEd> Qed, const matrix<dDd> & Red);
37  seriesET(const matrix<gNg> & Ltg, const matrix<seriesTg> Qtg, const matrix<gNg> & Rtg);
38 
39  void toQtg_polynomial_case();
40  void toQed_polynomial_case();
41  void toQtg_series_case();
42  void toQed_series_case();
43 
44  void extendQed(unsigned mul);
45  void extendQtg(unsigned mul);
46 
47  static seriesTg truncTg(const seriesTg &, int n, int gamma);
48  static seriesEd truncEd(const seriesEd &, int n, int delta);
49 
50  public:
51 
52  static seriesTg scale(const seriesTg & s, unsigned mul);
53  static seriesEd scale(const seriesEd & s, unsigned mul);
54 
56  static seriesET Epsilon();
58  static seriesET Top();
60  static seriesET E();
62  seriesET();
64  seriesET(bool TopNotE);
66  seriesET(const seriesEd & s);
68  seriesET(const seriesTg & s);
69 
71  matrix<dDd> getLed() const;
73  matrix<dDd> getRed() const;
75  matrix<seriesEd> getQed() const;
76 
78  matrix<gNg> getLtg() const;
80  matrix<gNg> getRtg() const;
82  matrix<seriesTg> getQtg() const;
83 
85  bool isCoreEd() const { return _QEdForm; }
87  bool isCoreTg() const { return !_QEdForm; }
88 
90  void getLcmGainEd(unsigned int & mu, unsigned int& beta) const;
91  void getLcmGainTg(unsigned int & v, unsigned int& w) const;
92  void getLcmQSlope(int & g, int & d) const;
93 
95  void toCoreEd();
97  void toCoreTg();
98  // extends the Core representation
99  void extendBy(unsigned mul);
101  seriesET oplus(const seriesET & s) const;
103  seriesET otimes(const seriesET & s) const;
105  seriesET star() const;
107  seriesET inf(const seriesET & s) const;
109  seriesET lfrac(const seriesET & s) const;
111  seriesET rfrac(const seriesET & s) const;
112 
114  seriesET operator+(const seriesET & s) const;
116  seriesET operator*(const seriesET & s) const;
117 
119  void changeForm();
120 
122  bool isPolynomial() const;
123 
125  bool isE() const;
126 
128  void canon();
130  void toRight();
132  void toLeft();
133 
134  void toLVectorEd(matrix<seriesEd> & LV, matrix<dDd> & R) const;
135  void toRVectorEd(matrix<seriesEd> & RV, matrix<dDd> & L) const;
136 
137  void toLVectorTg(matrix<seriesTg> & LV, matrix<gNg> & R) const;
138  void toRVectorTg(matrix<seriesTg> & RV, matrix<gNg> & L)const ;
139 
140 
141  static etvo::matrix<seriesEd> getMatNed(unsigned size);
142  static etvo::matrix<seriesTg> getMatNtg(unsigned size);
143 
144  static seriesET toCausal(const seriesET & s);
145 
147  std::string toString(unsigned f=0) const;
148 
149 
150  friend seriesET etg(int n, bool QedForm );
151  friend seriesET etd(int t, bool QedForm );
152  friend seriesET etm(unsigned m, bool QedForm );
153  friend seriesET etb(unsigned b, bool QedForm );
154  friend seriesET etm(const std::vector<unsigned> & seq);
155  friend seriesET etb(const std::vector<unsigned> & seq);
156  friend seriesET etd(const std::vector<int> & seqDelays);
157  friend seriesET etv(unsigned v, bool QedForm );
158  friend seriesET etw(unsigned w, bool QedForm);
159 
160  };
161 
162  std::ostream & operator<<(std::ostream & f, const seriesET & s);
163 
164 
165  // necessary for matrix<T> computations.
166  seriesET star(const seriesET & s);
167  seriesET oplus(const seriesET &, const seriesET &);
168  seriesET inf(const seriesET &, const seriesET &);
169  seriesET otimes(const seriesET &, const seriesET &);
170  seriesET lfrac(const seriesET &, const seriesET &);
171  seriesET rfrac(const seriesET &, const seriesET &);
172 
174  seriesET etg(int n,bool QedForm=true);
176  seriesET etd(int t,bool QedForm = true);
178  seriesET etm(unsigned m,bool QedForm = true);
179  seriesET etm(const std::vector<unsigned> & seq);
180  seriesET etb(const std::vector<unsigned> & seq);
181  seriesET etd(const std::vector<int> & seqDelays);
182 
184  seriesET etb(unsigned b, bool QedForm = true);
186  seriesET etv(unsigned v, bool QedForm = true);
188  seriesET etw(unsigned w, bool QedForm = true);
189 
190 
191  /*
193  seriesET etm(const std::vector<unsigned> & seq);
195  seriesET etb(const std::vector<unsigned> & seq);
196 
197  // necessary for matrix<T> computations.
198  seriesET star(const seriesET & s);
199  seriesET oplus(const seriesET &, const seriesET &);
200  seriesET inf(const seriesET &, const seriesET &);
201  seriesET otimes(const seriesET &, const seriesET &);
202  seriesET lfrac(const seriesET &, const seriesET &);
203  seriesET rfrac(const seriesET &, const seriesET &);
204 
205  */
206 } // end namespace etvo
207 
208 #endif // SERIESET_H
static seriesET E()
The description of g0.d0 as seriesET.
Definition: seriesET.cpp:300
bool isCoreTg() const
check if the current series is in Qtg form (Q in T[[g]])
Definition: seriesET.h:87
friend seriesET etg(int n, bool QedForm)
element g^n in ET
Definition: seriesET.cpp:18
seriesET otimes(const seriesET &s) const
otimes product of seriesET
Definition: seriesET.cpp:1126
matrix< dDd > getRed() const
getter returning Red
Definition: seriesET.cpp:305
void toRight()
to Right form (all core series in right form)
Definition: seriesET.cpp:180
seriesET inf(const seriesET &s) const
infimum of seriesET
Definition: seriesET.cpp:1223
Class for ultimately-periodic series in the semiring T[[g]].
Definition: seriesTg.h:25
void toLeft()
to Left form (all core series in left form)
Definition: seriesET.cpp:164
std::ostream & operator<<(std::ostream &f, const dDd &m)
Definition: dDd.cpp:313
Definition: matrixWrapper.h:33
Definition: etvoException.cpp:5
void changeForm()
CoreEd <-> CoreTg.
Definition: seriesET.cpp:845
seriesET etw(unsigned w, bool QEdForm)
element wedge_w in ET (Time divider)
Definition: seriesET.cpp:143
seriesET etv(unsigned v, bool QEdForm)
element vee_v in ET (Time multiplier)
Definition: seriesET.cpp:122
seriesET()
Default initialization : epsilon.
Definition: seriesET.cpp:249
Class for ultimately-periodic series in the semiring ET.
Definition: seriesET.h:25
void getLcmGainTg(unsigned int &v, unsigned int &w) const
returns the Least Common multiple of gains in the terms of the current series
Definition: seriesET.cpp:343
friend seriesET etv(unsigned v, bool QedForm)
element vee_v in ET (Time multiplier)
Definition: seriesET.cpp:122
friend seriesET etw(unsigned w, bool QedForm)
element wedge_w in ET (Time divider)
Definition: seriesET.cpp:143
static seriesET Top()
The Top description of seriesET.
Definition: seriesET.cpp:298
seriesET oplus(const seriesET &s) const
oplus sum of seriesET
Definition: seriesET.cpp:1065
bool isCoreEd() const
check if the current series is in Qed form (Q in E[[d]])
Definition: seriesET.h:85
friend seriesET etm(unsigned m, bool QedForm)
element mu_m in ET (Event multiplier)
Definition: seriesET.cpp:60
bool isPolynomial() const
check if it is a polynomial
Definition: seriesET.cpp:420
std::string toString(unsigned f=0) const
returns the string description of a series in ET.
Definition: seriesET.cpp:1521
seriesET etd(int t, bool QEdForm)
element d^t in ET
Definition: seriesET.cpp:39
matrix< seriesTg > getQtg() const
getter returning Qtg
Definition: seriesET.cpp:314
seriesET etg(int n, bool QEdForm)
element g^n in ET
Definition: seriesET.cpp:18
void getLcmGainEd(unsigned int &mu, unsigned int &beta) const
returns the Least Common multiple of gains in the terms of the current series
Definition: seriesET.cpp:317
friend seriesET etd(int t, bool QedForm)
element d^t in ET
Definition: seriesET.cpp:39
void getLcmQSlope(int &g, int &d) const
returns the Least Common multiple of ultimate slopes (g^n d^t)* of Q terms
Definition: seriesET.cpp:369
void canon()
leads to the canonical form
Definition: seriesET.cpp:197
matrix< dDd > getLed() const
getter returning Led
Definition: seriesET.cpp:303
seriesET rfrac(const seriesET &s) const
right residual
Definition: seriesET.cpp:1329
Class for ultimately-periodic series in the semiring E[[d]]. In a general way, the series are describ...
Definition: seriesEd.h:40
seriesET etm(unsigned m, bool QEdForm)
element mu_m in ET (Event multiplier)
Definition: seriesET.cpp:60
void toCoreTg()
to a form where the Core is in T[[g]]
Definition: seriesET.cpp:817
seriesET operator+(const seriesET &s) const
sum of series in ET : s1+s2
Definition: seriesET.cpp:1213
seriesET star() const
Kleene star of seriesET.
Definition: seriesET.cpp:1184
matrix< seriesEd > getQed() const
getter returning Qed
Definition: seriesET.cpp:307
static seriesET Epsilon()
The epsilon description of seriesET.
Definition: seriesET.cpp:296
Abstract base class to handle Idempotent Semiring terms.
Definition: ISterm.h:27
bool isE() const
check if it is a neutral seriesET
matrix< gNg > getLtg() const
getter returning Ltg
Definition: seriesET.cpp:310
friend seriesET etb(unsigned b, bool QedForm)
element beta_b in ET (EVent divider)
Definition: seriesET.cpp:99
matrix< gNg > getRtg() const
getter returning Rtg
Definition: seriesET.cpp:312
void toCoreEd()
to a form where the Core is in E[[d]]
Definition: seriesET.cpp:831
seriesET operator*(const seriesET &s) const
product of series in ET : s1*s2
Definition: seriesET.cpp:1218
seriesET lfrac(const seriesET &s) const
left residual
Definition: seriesET.cpp:1284