(Event+Time).Variant Operators  2.3
Operators for Timed Discrete Event Systems in Dioids
polyTg.h
1 #ifndef POLYTG_H
2 #define POLYTG_H
3 #include "Tg.h"
4 #include "../common/ISterm.h"
5 
6 #include "../wrapperMMGD/polyWrapper.h"
7 #include "../wrapperMMGD/matrixWrapper.h"
8 
9 namespace etvo
10 {
11  class seriesTg;
23 class polyTg:public ISterm
24 {
25 public:
27  static polyTg Epsilon();
29  static polyTg Top();
31  static polyTg E();
32 
34  polyTg();
36  polyTg(bool TopNotE); //true Top false E
38  polyTg(const Tg & m);
41  polyTg(const std::vector<Tg> & v);
42 
44  void canon();
46  bool isCanon() const;
48  bool isE() const;
50  polyTg operator+(const polyTg &p) const;
52  polyTg oplus(const polyTg &p) const;
54  polyTg oplusCD(const polyTg &p) const;
56  polyTg operator+(const Tg & m)const;
58  void add(const Tg & m);
60  polyTg operator+=(const Tg & m);
61 
63  polyTg operator*(const polyTg & p) const;
65  polyTg otimes(const polyTg &p) const;
67  polyTg operator*(const Tg & m) const;
68  static polyTg otimes(const Tg & m, const polyTg & p);
70  polyTg otimesCD(const polyTg &p) const;
71 
73  polyTg inf(const polyTg & p) const;
75  polyTg infCD(const polyTg & p) const;
76 
78  seriesTg star() const;
79 
81  polyTg lfrac(const polyTg & p) const;
83  polyTg lfracCD(const polyTg & p) const;
85  polyTg lfrac(const Tg & m) const;
87  polyTg rfrac(const polyTg & p) const;
89  polyTg rfracCD(const polyTg & p) const;
91  polyTg rfrac(const Tg & m) const;
93  bool operator==(const polyTg &)const;
95  bool operator!=(const polyTg &)const;
97  bool operator<=(const polyTg &) const;
99  bool operator>=(const polyTg &) const;
100 
102  static polyTg toPolyTg(const poly & p);
104  poly toPoly() const;
106  static polyTg toCausal(const polyTg & p);
109  Tg getFirstDif(const polyTg & p) const;
111  polyTg transientStar(int Tmax) const;
113  void getMaxGain(unsigned int & vee, unsigned int & wedge) const;
115  void getLcmGain(unsigned int & vee, unsigned int & wedge) const;
117  std::pair<unsigned int, unsigned int> getPeriodicity() const;
119  std::vector<Tg> getTerms() const;
121  void removeTerm(unsigned idx);
123  Tg operator[](unsigned idx) const;
125  unsigned int size() const;
127  std::string toString() const;
129  std::string toStringAsDeltaVar() const;
130 
132  matrix<poly> getCore(unsigned ratio = 1) const;
134  static polyTg coreToPolyTg(const matrix<poly>& core);
135 
136  static etvo::matrix<poly> getMatN(unsigned size);
138  matrix<poly> getCoreMax(unsigned ratio = 1) const;
139 
142 
143 private:
144  void sort();
145  void simplify();
146  std::vector<Tg> _poly;
147 };
148 std::ostream & operator<<(std::ostream & st,const polyTg & p);
149 }
150 
151 #endif // POLYTG_H
polyTg otimes(const polyTg &p) const
Product of polynomials in T[[g]].
Definition: polyTg.cpp:212
polyTg oplusCD(const polyTg &p) const
Sum of polynomials in T[[g]] via a Core Decomposition (see J.Trunk Thesis)
Definition: polyTg.cpp:98
void toPov(graphicPR::PovRay &pov, graphicPR::PovRay::Color c)
used in the creation of POV-Ray script for a polyTg object
Definition: polyTg.cpp:706
void removeTerm(unsigned idx)
remove term number i in the polynomial
Definition: polyTg.cpp:559
polyTg inf(const polyTg &p) const
Infimum of two polynomials in T[[g]].
Definition: polyTg.cpp:267
std::string toStringAsDeltaVar() const
returns a description of the current polynomial (the gain must be 1)
Definition: polyTg.cpp:593
bool isCanon() const
Check if a polyTg is in canonical form.
Definition: polyTg.cpp:47
void getLcmGain(unsigned int &vee, unsigned int &wedge) const
Gives th Least Common multiple of gains.
Definition: polyTg.cpp:532
std::vector< Tg > getTerms() const
return the monomials as a collection of Tg terms
Definition: polyTg.cpp:554
bool operator!=(const polyTg &) const
Check difference.
Definition: polyTg.cpp:413
the script description of a color in POV-Ray
Definition: PovRay.h:38
Class for ultimately-periodic series in the semiring T[[g]].
Definition: seriesTg.h:25
polyTg()
initialised with Epsilon element
Definition: polyTg.cpp:27
polyTg transientStar(int Tmax) const
Do not use it. Use polyTg::star(). Only for DEBUGGING purpose.
Definition: polyTg.cpp:497
Class for monomials in the semiring T[[g]].
Definition: Tg.h:22
static polyTg toPolyTg(const poly &p)
Creates a polynomial in T[[g]] from a polynomial in MinMax[[g,d]].
Definition: polyTg.cpp:432
polyTg operator+(const polyTg &p) const
Sum of polynomials in T[[g]].
Definition: polyTg.cpp:76
std::ostream & operator<<(std::ostream &f, const dDd &m)
Definition: dDd.cpp:313
Definition: matrixWrapper.h:33
Definition: etvoException.cpp:5
polyTg otimesCD(const polyTg &p) const
Product of polynomials in T[[g]] via a Core Decomposition (see j.Trunk thesis)
Definition: polyTg.cpp:249
Tg operator[](unsigned idx) const
Returns a copy of monomial in position idx in the polynomial.
Definition: polyTg.cpp:565
void getMaxGain(unsigned int &vee, unsigned int &wedge) const
Gives the maximal gain.
Definition: polyTg.cpp:514
bool operator>=(const polyTg &) const
Check order on polynomials in E[[d]].
Definition: polyTg.cpp:426
void add(const Tg &m)
The current polynomial pcur is modified as pcur=pcur+m.
Definition: polyTg.cpp:143
seriesTg star() const
Kleene star of a polynomial in T[[g]], the result is a series in T[[g]].
Definition: polyTg.cpp:303
bool operator<=(const polyTg &) const
Check order on polynomials in E[[d]].
Definition: polyTg.cpp:420
poly toPoly() const
The zero-slice polynomial in MinMax[[g,d]].
Definition: polyTg.cpp:448
void canon()
set to the canonical form
Definition: polyTg.cpp:63
static polyTg E()
neutral element
Definition: polyTg.cpp:21
matrix< poly > getCoreMax(unsigned ratio=1) const
returns the maximal Core matrix<poly> (in MinMax[[g,d]]) of the current polynomial ...
Definition: polyTg.cpp:697
polyTg lfrac(const polyTg &p) const
Computation of the left-multiplication residuation:
Definition: polyTg.cpp:309
static polyTg toCausal(const polyTg &p)
returns the projection of p into the set of causal series in T[[g]] (not reliable yet) ...
Definition: polyTg.cpp:461
polyTg rfrac(const polyTg &p) const
Computation of the right-multiplication residuation:
Definition: polyTg.cpp:354
polyTg lfracCD(const polyTg &p) const
Computation of the left-multiplication residuation via a Core Decomposition.
Definition: polyTg.cpp:324
static polyTg Epsilon()
Epsilon element.
Definition: polyTg.cpp:19
static polyTg coreToPolyTg(const matrix< poly > &core)
computes the recomposition of a polyTg polynomial from a Core Decomposition core. ...
Definition: polyTg.cpp:659
polyTg operator+=(const Tg &m)
Lies on polyTg::add(const Tg & m) method.
Definition: polyTg.cpp:171
polyTg operator*(const polyTg &p) const
Product of polynomials in T[[g]].
Definition: polyTg.cpp:195
bool isE() const
check if is equal to E()=g0.d0
Definition: polyTg.cpp:70
unsigned int size() const
Returns the size = the number of monomials. For Epsilon and Top, size=0.
Definition: polyTg.cpp:570
polyTg infCD(const polyTg &p) const
Infimum of two polynomials in T[[g]] via a Core Decomposition (see J.Trunk thesis) ...
Definition: polyTg.cpp:284
std::pair< unsigned int, unsigned int > getPeriodicity() const
Returns the periodicity as a pair.
Definition: polyTg.cpp:547
Tg getFirstDif(const polyTg &p) const
Definition: polyTg.cpp:486
std::string toString() const
returns a string that gives the description of the current polynomial. Is depending on the canonical ...
Definition: polyTg.cpp:575
polyTg oplus(const polyTg &p) const
Sum of polynomials in T[[g]].
Definition: polyTg.cpp:93
Wrapper class to mmgd::poly from from MinMaxGD library.
Definition: polyWrapper.h:34
bool operator==(const polyTg &) const
Check equality.
Definition: polyTg.cpp:399
Abstract base class to handle Idempotent Semiring terms.
Definition: ISterm.h:27
Used to generate POV-Ray scripts to draw 3D descriptions of polyEd and polyTg objects.
Definition: PovRay.h:19
polyTg rfracCD(const polyTg &p) const
Computation of the right-multiplication residuation via a Core Decomposition.
Definition: polyTg.cpp:370
Class for polynomials in the semiring T[[g]].
Definition: polyTg.h:23
matrix< poly > getCore(unsigned ratio=1) const
returns the Core matrix<poly> (in MinMax[[g,d]]) of the current polynomial
Definition: polyTg.cpp:611
static polyTg Top()
Top element.
Definition: polyTg.cpp:23