Skip to content

Commit

Permalink
Binomial::multiply
Browse files Browse the repository at this point in the history
  • Loading branch information
tom111 committed May 1, 2012
1 parent 6b7b4f7 commit fc5559e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cpp/binomial.cpp
Expand Up @@ -104,6 +104,10 @@ Binomial::~Binomial () {
delete tail;
}

Binomial* Binomial::multiply (const Monomial& m) const {
return new Binomial (*head->multiply(m),*tail->multiply(m));
}

unsigned int Binomial::degree () const {
unsigned int d1 = head->degree() , d2 = tail->degree();
if (d1 != d2) {
Expand Down
1 change: 1 addition & 0 deletions cpp/binomial.h
Expand Up @@ -48,6 +48,7 @@ class Binomial {
Binomial (const Binomial& b); // copy
~Binomial ();
unsigned int degree() const;
Binomial* multiply (const Monomial& m) const;
};

#endif

0 comments on commit fc5559e

Please sign in to comment.