FAUST compiler  0.9.9.6b8
Public Member Functions | List of all members
CeilPrim Class Reference
Inheritance diagram for CeilPrim:
Inheritance graph
[legend]
Collaboration diagram for CeilPrim:
Collaboration graph
[legend]

Public Member Functions

 CeilPrim ()
 
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)
 
- Public Member Functions inherited from xtended
 xtended (const char *name)
 
virtual ~xtended ()
 
Sym symbol ()
 
const char * name ()
 
Tree box ()
 
virtual bool isSpecialInfix ()
 generaly false, but true for binary op # such that #(x) == _::x More...
 

Detailed Description

Definition at line 7 of file ceilprim.cpp.

Constructor & Destructor Documentation

CeilPrim::CeilPrim ( )
inline

Definition at line 12 of file ceilprim.cpp.

12 : xtended("ceil") {}
xtended(const char *name)
Definition: xtended.hh:18

Member Function Documentation

virtual unsigned int CeilPrim::arity ( )
inlinevirtual

Implements xtended.

Definition at line 14 of file ceilprim.cpp.

Referenced by computeSigOutput(), generateCode(), generateLateq(), infereSigOrder(), and infereSigType().

14 { return 1; }

Here is the caller graph for this function:

virtual Tree CeilPrim::computeSigOutput ( const vector< Tree > &  args)
inlinevirtual

Implements xtended.

Definition at line 32 of file ceilprim.cpp.

References arity(), isNum(), xtended::symbol(), and tree().

32  {
33  num n;
34  assert (args.size() == arity());
35  if (isNum(args[0],n)) {
36  return tree(ceil(double(n)));
37  } else {
38  return tree(symbol(), args[0]);
39  }
40  }
Definition: num.hh:58
virtual unsigned int arity()
Definition: ceilprim.cpp:14
bool isNum(Tree a)
Definition: signals.hh:187
Sym symbol()
Definition: xtended.hh:24
Tree tree(const Node &n)
Definition: tree.hh:186

Here is the call graph for this function:

virtual string CeilPrim::generateCode ( Klass klass,
const vector< string > &  args,
const vector< Type > &  types 
)
inlinevirtual

Implements xtended.

Definition at line 42 of file ceilprim.cpp.

References arity(), isuffix(), and subst().

43  {
44  assert (args.size() == arity());
45  assert (types.size() == arity());
46 
47  return subst("ceil$1($0)", args[0], isuffix());
48  }
virtual unsigned int arity()
Definition: ceilprim.cpp:14
string subst(const string &model, const vector< string > &args)
Text substitution.
Definition: Text.cpp:47
const char * isuffix()
suffix for math functions
Definition: floats.cpp:43

Here is the call graph for this function:

virtual string CeilPrim::generateLateq ( Lateq lateq,
const vector< string > &  args,
const vector< Type > &  types 
)
inlinevirtual

Implements xtended.

Definition at line 50 of file ceilprim.cpp.

References arity(), and subst().

51  {
52  assert (args.size() == arity());
53  assert (types.size() == arity());
54 
55  return subst("\\left\\lceil $0 \\right\\rceil", args[0]);
56  }
virtual unsigned int arity()
Definition: ceilprim.cpp:14
string subst(const string &model, const vector< string > &args)
Text substitution.
Definition: Text.cpp:47

Here is the call graph for this function:

virtual int CeilPrim::infereSigOrder ( const vector< int > &  args)
inlinevirtual

Implements xtended.

Definition at line 26 of file ceilprim.cpp.

References arity().

26  {
27  assert (args.size() == arity());
28  return args[0];
29  }
virtual unsigned int arity()
Definition: ceilprim.cpp:14

Here is the call graph for this function:

virtual Type CeilPrim::infereSigType ( const vector< Type > &  args)
inlinevirtual

Implements xtended.

Definition at line 18 of file ceilprim.cpp.

References arity(), and floatCast().

19  {
20  assert (args.size() == arity());
21  return floatCast(args[0]);
22  }
virtual unsigned int arity()
Definition: ceilprim.cpp:14
Type floatCast(Type t)
Definition: sigtype.hh:270

Here is the call graph for this function:

virtual bool CeilPrim::needCache ( )
inlinevirtual

Implements xtended.

Definition at line 16 of file ceilprim.cpp.

16 { return true; }
virtual void CeilPrim::sigVisit ( Tree  sig,
sigvisitor visitor 
)
inlinevirtual

Definition at line 24 of file ceilprim.cpp.

24 {}

The documentation for this class was generated from the following file: