Permalink
Browse files

Binomial::multiply

  • Loading branch information...
1 parent 6b7b4f7 commit fc5559ef56e41c9a709f0c40816f2d4ca5253a66 @tom111 committed May 1, 2012
Showing with 5 additions and 0 deletions.
  1. +4 −0 cpp/binomial.cpp
  2. +1 −0 cpp/binomial.h
View
@@ -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) {
View
@@ -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.