X-Git-Url: https://scm.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/c7f552fd8888da2f0d8cfb228fe0f28d3df3a12c..b4b6f2ea75b9f0f3ca918f5b84016610bf7a4d4f:/interpretor/faust-0.9.47mr3/compiler/normalize/mterm.hh diff --git a/interpretor/faust-0.9.47mr3/compiler/normalize/mterm.hh b/interpretor/faust-0.9.47mr3/compiler/normalize/mterm.hh deleted file mode 100644 index a4aa868..0000000 --- a/interpretor/faust-0.9.47mr3/compiler/normalize/mterm.hh +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef __MTERM__ -#define __MTERM__ - -#include -#include -#include "tlib.hh" -#include "signals.hh" -#include "sigprint.hh" -#include "simplify.hh" -#include "normalize.hh" -#include "sigorderrules.hh" -#include -#include - -using namespace std; - -/** - * Implements a multiplicative term, a term of type - * k*x^n*y^m*... and its arithmetic - */ -class mterm -{ - - Tree fCoef; ///< constant part of the term (usually 1 or -1) - map fFactors; ///< non constant terms and their power - - public: - mterm (); ///< create a 0 mterm - mterm (int k); ///< create a simple integer mterm - mterm (double k); ///< create a simple float mterm - mterm (Tree t); ///< create a mterm from a multiplicative exp - mterm (const mterm& m); ///< create a copy of a mterm - - void cleanup(); ///< remove usued factors - bool isNotZero() const; ///< true if mterm doesn't represent number 0 - bool isNegative() const; ///< true if mterm has a negative coefficient - - const mterm& operator = (const mterm& m); ///< replace the content with a copy of m - - const mterm& operator *= (Tree m); ///< multiply in place by a multiplicative exp - const mterm& operator /= (Tree m); ///< divide in place by a multiplicative exp - - const mterm& operator += (const mterm& m); ///< add in place an mterm of same signature - const mterm& operator -= (const mterm& m); ///< add in place an mterm of same signature - - const mterm& operator *= (const mterm& m); ///< multiply in place by a mterm - const mterm& operator /= (const mterm& m); ///< divide in place by a mterm - - mterm operator * (const mterm& m) const; ///< mterms multiplication - mterm operator / (const mterm& m) const; ///< mterms division - ostream& print(ostream& dst) const; ///< print a mterm k*x1**n1*x2**n2... - - int complexity() const; ///< return an evaluation of the complexity - Tree normalizedTree(bool sign=false, - bool neg=false) const; ///< return the normalized tree of the mterm - Tree signatureTree() const; ///< return a signature (a normalized tree) - - bool hasDivisor (const mterm& n) const; ///< return true if this can be divided by n - friend mterm gcd (const mterm& m1, const mterm& m2); /// greatest common divisor of two mterms -}; - -inline ostream& operator << (ostream& s, const mterm& m) { return m.print(s); } - - -#endif