FAUST compiler  0.9.9.6b8
Typedefs | Functions
aterm.cpp File Reference
#include "aterm.hh"
#include "ppsig.hh"
Include dependency graph for aterm.cpp:

Go to the source code of this file.

Typedefs

typedef map< Tree, mtermSM
 

Functions

static Tree simplifyingAdd (Tree t1, Tree t2)
 Add two terms trying to simplify the result. More...
 

Typedef Documentation

typedef map<Tree,mterm> SM

Definition at line 9 of file aterm.cpp.

Function Documentation

static Tree simplifyingAdd ( Tree  t1,
Tree  t2 
)
static

Add two terms trying to simplify the result.

Definition at line 33 of file aterm.cpp.

References addNums(), isNum(), isZero(), and sigAdd().

Referenced by aterm::normalizedTree().

34 {
35  assert(t1!=0);
36  assert(t2!=0);
37 
38  if (isNum(t1) && isNum(t2)) {
39  return addNums(t1,t2);
40 
41  } else if (isZero(t1)) {
42  return t2;
43 
44  } else if (isZero(t2)) {
45  return t1;
46 
47  } else if (t1 <= t2) {
48  return sigAdd(t1, t2);
49 
50  } else {
51  return sigAdd(t2, t1);
52  }
53 }
bool isZero(Tree a)
Definition: signals.hh:188
bool isNum(Tree a)
Definition: signals.hh:187
Tree addNums(Tree a, Tree b)
Definition: signals.cpp:295
Tree sigAdd(Tree x, Tree y)
Definition: signals.hh:152

Here is the call graph for this function:

Here is the caller graph for this function: