FAUST compiler  0.9.9.6b8
Functions
occurences.cpp File Reference
#include <assert.h>
#include <stdlib.h>
#include "recursivness.hh"
#include "occurences.hh"
#include "sigtype.hh"
#include "sigtyperules.hh"
#include <iostream>
Include dependency graph for occurences.cpp:

Go to the source code of this file.

Functions

static int xVariability (int v, int r)
 Extended Variability with recursiveness indication. More...
 
static int position (Tree env, Tree t, int p)
 return the position of a signal in the current recursive environment More...
 

Function Documentation

static int position ( Tree  env,
Tree  t,
int  p 
)
static

return the position of a signal in the current recursive environment

Parameters
envthe current recursive environment of the signal
tsignal we want to know the position
Returns
the position in the recursive environment

Definition at line 168 of file occurences.cpp.

References hd(), isNil(), and tl().

169 {
170  if (isNil(env)) return 0; // was not in the environment
171  if (hd(env) == t) return p;
172  else return position (tl(env), t, p+1);
173 }
static int position(Tree env, Tree t, int p)
return the position of a signal in the current recursive environment
Definition: occurences.cpp:168
Tree hd(Tree l)
Definition: list.hh:133
bool isNil(Tree l)
Definition: list.hh:137
Tree tl(Tree l)
Definition: list.hh:134

Here is the call graph for this function:

static int xVariability ( int  v,
int  r 
)
static

Extended Variability with recursiveness indication.

Definition at line 14 of file occurences.cpp.

References min().

Referenced by Occurences::incOccurences().

15 {
16  //cerr << "xVariability (" << v << ", " << r << ")" << endl;
17  //assert (v < 3); // kKonst=0, kBlock=1, kSamp=2
18  //assert(r==0 | v==2);
19  if (r>1) r=1;
20  return min(3, v + r);
21 }
double min(double x, double y)
Definition: interval.hh:59

Here is the call graph for this function:

Here is the caller graph for this function: