Permalink
Browse files

relace isSame with == operator

  • Loading branch information...
1 parent d18fde0 commit 9cea8cbacbd965648f67fe0e5ff2030fb395a4d9 @tom111 committed Apr 27, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −1 cpp/monomial.cpp
  2. +1 −1 cpp/monomial.h
View
3 cpp/monomial.cpp
@@ -99,7 +99,8 @@ long Monomial::degree() const {
return result;
};
-bool Monomial::isSame (const Monomial& m) const {
+bool Monomial::operator== (const Monomial& m) const {
+ if (length != m.length) return false;
for (int i=0; i<length; i++){
if ( (*exponents)[i] != (*m.exponents)[i]) { return false; };
};
View
2 cpp/monomial.h
@@ -61,7 +61,7 @@ class Monomial {
// Monomial* divide (Monomial *m);
long degree() const;
- bool isSame (const Monomial& m) const;
+ bool operator== (const Monomial& m) const;
Monomial* applyBinomialSafe (const Binomial& b) const;
Monomial* applyBinomialSafeReverse (const Binomial& b) const;
bool isProper () const;

0 comments on commit 9cea8cb

Please sign in to comment.