{
// Type definitions
typedef int index_t;
typedef typename R::exponent_t exponent_t; //typename R::coeff_t exponent_t;
typedef C coeff_t;
typedef Monom self_t;
// Constructors
Monom():coeff(0),rep(){}
Monom(const C & c, const R & r):coeff(c),rep(r){}
Monom(const C & c):coeff(c),rep(){} // monome constant
Monom(int i):coeff(i){}
Monom(int i, int d); // monome x_i^d
Monom(const C & c, int i, int d =1); // monome c*x_i^d
Monom(const C & c, int s, int *t):coeff(c), rep(s){
for(int i=0;i(m);}
template
Monom(const VAL & M) {assign(*this,M.rep);}
// Destructor
// not dynamic allocation at this level
// Assignement
self_t & operator = (const self_t & m);
template
self_t & operator = (const VAL & M)
{assign(*this,M.rep); return *this;}
// Accessors
// int size() const {return rep.size;}
C GetCoeff () const { return coeff; }
void SetCoeff (const C & c) { coeff = c; }
int Lvar() const { return lvar(rep); }
exponent_t operator[] (int i) const { return rep[i]; }
exponent_t GetDegree (int i) const { return rep[i]; }
void setExponent (int i, int d) { rep.setExponent(i,d); }
// boolean opeartors and functions
bool operator==(int n) const;
bool operator!=(int n) const {return !(*this==n);}
friend bool operator == (const self_t & m1, const self_t & m2) {
return m1.coeff == m2.coeff && m1.rep == m2.rep;
}
friend bool IsComparable (const self_t & m1, const self_t & m2){
return m1.rep == m2.rep;
}
// Arithmetic operators
self_t operator - () const {return self_t(-coeff,rep);}
self_t & operator += (const self_t &);
self_t & operator -= (const self_t &);
self_t & operator *= (const self_t &);
self_t & operator *= (const C &);
self_t & operator /= (const C &);
//private:
C coeff;
R rep;
};