|
FAUST compiler
0.9.9.6b8
|


Public Member Functions | |
| RintPrim () | |
| virtual unsigned int | arity () |
| virtual bool | needCache () |
| virtual Type | infereSigType (const vector< Type > &args) |
| virtual void | sigVisit (Tree sig, sigvisitor *visitor) |
| virtual int | infereSigOrder (const vector< int > &args) |
| virtual Tree | computeSigOutput (const vector< Tree > &args) |
| virtual string | generateCode (Klass *klass, const vector< string > &args, const vector< Type > &types) |
| virtual string | generateLateq (Lateq *lateq, const vector< string > &args, const vector< Type > &types) |
Definition at line 18 of file rintprim.cpp.
| RintPrim::RintPrim | ( | ) | [inline] |
Definition at line 23 of file rintprim.cpp.
: xtended("rint") {}
| virtual unsigned int RintPrim::arity | ( | ) | [inline, virtual] |
Implements xtended.
Definition at line 25 of file rintprim.cpp.
Referenced by computeSigOutput(), generateCode(), generateLateq(), infereSigOrder(), and infereSigType().
{ return 1; }

| virtual Tree RintPrim::computeSigOutput | ( | const vector< Tree > & | args | ) | [inline, virtual] |
Implements xtended.
Definition at line 48 of file rintprim.cpp.
References arity(), isNum(), xtended::symbol(), and tree().
{
num n;
assert (args.size() == arity());
if (isNum(args[0],n)) {
return tree(rint(double(n)));
} else {
return tree(symbol(), args[0]);
}
}

| virtual string RintPrim::generateCode | ( | Klass * | klass, |
| const vector< string > & | args, | ||
| const vector< Type > & | types | ||
| ) | [inline, virtual] |
| virtual string RintPrim::generateLateq | ( | Lateq * | lateq, |
| const vector< string > & | args, | ||
| const vector< Type > & | types | ||
| ) | [inline, virtual] |
| virtual int RintPrim::infereSigOrder | ( | const vector< int > & | args | ) | [inline, virtual] |
Implements xtended.
Definition at line 42 of file rintprim.cpp.
References arity().
{
assert (args.size() == arity());
return args[0];
}

| virtual Type RintPrim::infereSigType | ( | const vector< Type > & | args | ) | [inline, virtual] |
Implements xtended.
Definition at line 29 of file rintprim.cpp.
References arity(), castInterval(), and floatCast().
{
assert (args.size() == arity());
interval i = args[0]->getInterval();
if (i.valid) {
return castInterval(floatCast(args[0]), interval(rint(i.lo), rint(i.hi)));
} else {
return floatCast(args[0]);
}
}

| virtual bool RintPrim::needCache | ( | ) | [inline, virtual] |
| virtual void RintPrim::sigVisit | ( | Tree | sig, |
| sigvisitor * | visitor | ||
| ) | [inline, virtual] |
Definition at line 40 of file rintprim.cpp.
{}
1.8.0