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

Public Member Functions

 Log10Prim ()
 
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 8 of file log10prim.cpp.

Constructor & Destructor Documentation

Log10Prim::Log10Prim ( )
inline

Definition at line 13 of file log10prim.cpp.

13 : xtended("log10") {}
xtended(const char *name)
Definition: xtended.hh:18

Member Function Documentation

virtual unsigned int Log10Prim::arity ( )
inlinevirtual

Implements xtended.

Definition at line 15 of file log10prim.cpp.

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

15 { return 1; }

Here is the caller graph for this function:

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

Implements xtended.

Definition at line 38 of file log10prim.cpp.

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

38  {
39  num n;
40  assert (args.size() == arity());
41  if (isNum(args[0],n)) {
42  return tree(log10(double(n)));
43  } else {
44  return tree(symbol(), args[0]);
45  }
46  }
Definition: num.hh:58
bool isNum(Tree a)
Definition: signals.hh:187
virtual unsigned int arity()
Definition: log10prim.cpp:15
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 Log10Prim::generateCode ( Klass klass,
const vector< string > &  args,
const vector< Type > &  types 
)
inlinevirtual

Implements xtended.

Definition at line 48 of file log10prim.cpp.

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

49  {
50  assert (args.size() == arity());
51  assert (types.size() == arity());
52 
53  return subst("log10$1($0)", args[0], isuffix());
54  }
virtual unsigned int arity()
Definition: log10prim.cpp:15
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 Log10Prim::generateLateq ( Lateq lateq,
const vector< string > &  args,
const vector< Type > &  types 
)
inlinevirtual

Implements xtended.

Definition at line 56 of file log10prim.cpp.

References arity(), and subst().

57  {
58  assert (args.size() == arity());
59  assert (types.size() == arity());
60 
61  return subst("\\log_{10}\\left( $0 \\right)", args[0]);
62  }
virtual unsigned int arity()
Definition: log10prim.cpp:15
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 Log10Prim::infereSigOrder ( const vector< int > &  args)
inlinevirtual

Implements xtended.

Definition at line 32 of file log10prim.cpp.

References arity().

32  {
33  assert (args.size() == arity());
34  return args[0];
35  }
virtual unsigned int arity()
Definition: log10prim.cpp:15

Here is the call graph for this function:

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

Implements xtended.

Definition at line 19 of file log10prim.cpp.

References arity(), castInterval(), and floatCast().

20  {
21  assert (args.size() == arity());
22  interval i = args[0]->getInterval();
23  if (i.valid && (i.lo > 0)) {
24  return castInterval(floatCast(args[0]), interval(log10(i.lo), log10(i.hi)));
25  } else {
26  return floatCast(args[0]);
27  }
28  }
virtual unsigned int arity()
Definition: log10prim.cpp:15
Type floatCast(Type t)
Definition: sigtype.hh:270
Type castInterval(Type t, const interval &i)
Definition: sigtype.hh:278

Here is the call graph for this function:

virtual bool Log10Prim::needCache ( )
inlinevirtual

Implements xtended.

Definition at line 17 of file log10prim.cpp.

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

Definition at line 30 of file log10prim.cpp.

30 {}

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