FAUST compiler  0.9.9.6b8
aterm.hh
Go to the documentation of this file.
1 #ifndef __ATERM__
2 #define __ATERM__
3 
4 #include <stdio.h>
5 #include <assert.h>
6 #include "tlib.hh"
7 #include "signals.hh"
8 #include "sigprint.hh"
9 #include "simplify.hh"
10 #include "normalize.hh"
11 #include "sigorderrules.hh"
12 #include <map>
13 #include <list>
14 
15 #include "mterm.hh"
16 
17 using namespace std;
18 
23 class aterm
24 {
25 
26  map<Tree,mterm> fSig2MTerms;
27 
28  public:
29  aterm ();
30  aterm (Tree t);
31  //aterm (const aterm& a); ///< create a copy of an aterm
32 
33  const aterm& operator += (Tree t);
34  const aterm& operator -= (Tree t);
35 
36  const aterm& operator += (const mterm& m);
37  const aterm& operator -= (const mterm& m);
38  Tree normalizedTree() const;
39 
40  ostream& print(ostream& dst) const;
41  mterm greatestDivisor() const;
42  aterm factorize(const mterm& d);
43 };
44 
45 inline ostream& operator << (ostream& s, const aterm& a) { return a.print(s); }
46 
47 
48 #endif
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Definition: tree.hh:109
Implements a multiplicative term, a term of type k*x^n*y^m*...
Definition: mterm.hh:21
map< Tree, mterm > fSig2MTerms
mapping between signatures and corresponding mterms
Definition: aterm.hh:26
ostream & operator<<(ostream &s, const aterm &a)
Definition: aterm.hh:45
Implements a additive term, a set of mterms added together m1 + m2 + m3 + ...
Definition: aterm.hh:23
ostream & print(ostream &dst) const
print a aterm m1 + m2 + m3 +...
Definition: aterm.cpp:107
void print(Tree t, FILE *out)
Definition: list.cpp:154