67 return dst <<
"NR"[
nature()]
112 for (
unsigned int i = 0; i <
fComponents.size(); i++, sep=
"*") {
126 for (
unsigned int i = 0; i <
fComponents.size(); i++) {
190 for (
int i=0; i<n; i++) { v.push_back( (*nt1)[i] | (*nt2)[i]); }
195 cerr <<
"Error : trying to combine incompatible types, " << t1 <<
" and " << t2 << endl;
207 if (t1->variability() != t2->variability())
return false;
208 if (t1->computability() != t2->computability())
return false;
222 int a1 = nt1->
arity();
223 int a2 = nt2->
arity();
225 for (
int i=0; i<a1; i++) {
if ((*nt1)[i] != (*nt2)[i])
return false; }
236 return (t1|t2) == t2;
249 for (
int i=0; i<nt1->
arity(); i++) {
250 v.push_back((*nt1)[i]);
257 for (
int i=0; i<nt2->
arity(); i++) {
258 v.push_back((*nt2)[i]);
281 cerr <<
"Error : checkInt failed for type " << t << endl;
290 if (t->variability() >
kKonst) {
291 cerr <<
"Error : checkKonst failed for type " << t << endl;
300 if (t->computability() >
kInit) {
301 cerr <<
"Error : checkInit failed for type " << t << endl;
315 if (wr->nature() > tbl->nature()) {
316 cerr <<
"Error : checkWRTbl failed, the content of " << tbl <<
" is incompatible with " << wr << endl;
331 return int(i.
hi+0.5);
342 return (t->nature() ==
kInt) ?
"int" :
"float";
382 if ((r=t->
getCode()))
return r;
391 cerr <<
"ERROR in codeAudioType() : invalide pointer " << t << endl;
427 if (MemoizedTypes.
get(code, t)) {
432 MemoizedTypes.
set(code, t);
454 if (MemoizedTypes.
get(code, tt)) {
459 MemoizedTypes.
set(code, tt);
471 if (MemoizedTypes.
get(code, tt)) {
476 MemoizedTypes.
set(code, tt);
488 if (MemoizedTypes.
get(code, tt)) {
493 MemoizedTypes.
set(code, tt);
507 for (
int i=0; i<nt->
arity(); i++) {
519 if (MemoizedTypes.
get(code, t)) {
524 MemoizedTypes.
set(code, t);
537 if (MemoizedTypes.
get(code, t)) {
542 MemoizedTypes.
set(code, t);
Type checkInit(Type t)
verifie que t est connu a l'initialisation
A tree library with hashconsing and maximal sharing capabilities.
Type checkKonst(Type t)
verifie que t est constant
bool valid
true if it is a valid interval
int fVariability
how fast values change
virtual bool isMaximal() const
true when type is maximal (and therefore can't change depending of hypothesis)
static Tree codeSimpleType(SimpleType *st)
Code a simple audio type as a tree in order to benefit of memoization.
int variability() const
returns how fast values change (constant, by blocks, by samples)
int fNature
the kind of data represented
static int gAllocationCount
interval getInterval() const
returns the interval (min dn max values) of a signal
vector< Type > fComponents
The type of a tuplet of data.
const Type fContent
type of that data stored in the table
property< AudioType * > MemoizedTypes
Type content() const
return the type of data store in the table
int fComputability
when are values available
int boolean() const
returns when a signal stands for a boolean value
Tree getCode()
returns the interval (min dn max values) of a signal
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
Tree codeAudioType(AudioType *t)
codeAudioType(Type) -> Tree Code an audio type as a tree in order to benefit of memoization The type ...
static Tree make(const Node &n, int ar, Tree br[])
return a new tree or an existing equivalent one
virtual bool isMaximal() const
true when type is maximal (and therefore can't change depending of hypothesis)
Type operator*(const Type &t1, const Type &t2)
bool operator<=(const Type &t1, const Type &t2)
ostream & operator<<(ostream &dst, const Type &t)
The type of a table of audio data.
void set(Tree t, const P &data)
Type operator|(const Type &t1, const Type &t2)
AudioType * makeSimpleType(int n, int v, int c, int vec, int b, const interval &i)
void setCode(Tree code)
returns the interval (min dn max values) of a signal
static Tree codeTupletType(TupletType *st)
Code a tuplet type as a tree in order to benefit of memoization.
Type checkIntParam(Type t)
verifie que t est connu a l'initialisation, constant et entier
Type checkWRTbl(Type tbl, Type wr)
verifie que wr est compatible avec le contenu de tbl
bool operator==(const Type &t1, const Type &t2)
AudioType * makeTupletType(const vector< Type > &vt)
int checkDelayInterval(Type t)
Check is a type is appropriate for a delay.
static Tree codeTableType(TableType *st)
Code a table type as a tree in order to benefit of memoization.
The type of a simple numeric audio signal.
bool get(Tree t, P &data)
AudioType * makeTableType(const Type &ct)
interval reunion(const interval &x, const interval &y)
interval fInterval
Minimal and maximal values the signal can take.
TableType * isTableType(AudioType *t)
int nature() const
returns the kind of values (integre or floating point)
TupletType * isTupletType(AudioType *t)
virtual ostream & print(ostream &dst) const
print a SimpleType
int computability() const
returns when values are available (compilation, initialisation, execution)
Symbols are unique objects with a name stored in a hash table.
Symbol * symbol(const char *str)
Returns (and creates if new) the symbol of name str.
virtual ostream & print(ostream &dst) const
Print the content of a tuplet of types on a stream.
SimpleType * isSimpleType(AudioType *t)
double min(double x, double y)
virtual ostream & print(ostream &dst) const
print a TableType
The Root class for all audio data types.
int vectorability() const
returns when a signal can be vectorized
Type checkInt(Type t)
verifie que t est entier
virtual bool isMaximal() const
true when type is maximal (and therefore can't change depending of hypothesis)