rewriting

parent 93386a2f
......@@ -33,6 +33,15 @@ class AbstractField {
void operator/=(const Element<U>& e) {
static_cast<T*>(this)->operator/=(e);
}
void operator==(const Element<U>& e) {
static_cast<T*>(this)->operator==(e);
}
void operator!=(const Element<U>& e) {
static_cast<T*>(this)->operator!=(e);
}
void neg() {
static_cast<T*>(this)->neg();
}
void inv() {
static_cast<T*>(this)->inv();
}
......
......@@ -43,13 +43,13 @@ class GFp_Givaro : public AbstractField<GFp_Givaro> {
inline bool is_zero() const { return k.isZero(v); }
friend std::ostream& operator<<(std::ostream&, const Element&);
friend std::istream& operator>>(std::istream&, Element&);
inline void neg() { v = -v; }
void operator+=(const Element& a) { k.addin(v, a.v); }
void operator-=(const Element& a) { k.subin(v, a.v); }
void operator*=(const Element& a) { k.mulin(v, a.v); }
void operator/=(const Element& a) { k.divin(v, a.v); }
bool operator==(const Element& a) const { return v == a.v; }
bool operator!=(const Element& a) const { return v != a.v; }
void neg() { v = -v; }
void inv() { k.invin(v); }
mpz_srcptr get_mpz() const { return v.get_mpz(); }
void set_mpz(const mpz_class& a) { k.init(v, elt_t(a)); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment