Log10Prim Class Reference

Inherits xtended.

Collaboration diagram for Log10Prim:
[legend]

List of all members.

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)

Detailed Description

Definition at line 8 of file log10prim.cpp.


Constructor & Destructor Documentation

Log10Prim::Log10Prim (  )  [inline]

Definition at line 13 of file log10prim.cpp.

00013 : xtended("log10f") {}


Member Function Documentation

virtual unsigned int Log10Prim::arity (  )  [inline, virtual]

Implements xtended.

Definition at line 15 of file log10prim.cpp.

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

00015 { return 1; }

Here is the caller graph for this function:

virtual Tree Log10Prim::computeSigOutput ( const vector< Tree > &  args  )  [inline, virtual]

Implements xtended.

Definition at line 38 of file log10prim.cpp.

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

00038                                                                 {
00039         num n;
00040         assert (args.size() == arity());
00041         if (isNum(args[0],n)) {
00042             return tree(log10(double(n)));
00043         } else {
00044             return tree(symbol(), args[0]);
00045         }
00046     }

Here is the call graph for this function:

virtual string Log10Prim::generateCode ( Klass klass,
const vector< string > &  args,
const vector< Type > &  types 
) [inline, virtual]

Implements xtended.

Definition at line 48 of file log10prim.cpp.

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

00049     {
00050         assert (args.size() == arity());
00051         assert (types.size() == arity());
00052         
00053         return subst("log10$1($0)", args[0], isuffix());
00054     }

Here is the call graph for this function:

virtual string Log10Prim::generateLateq ( Lateq lateq,
const vector< string > &  args,
const vector< Type > &  types 
) [inline, virtual]

Implements xtended.

Definition at line 56 of file log10prim.cpp.

References arity(), and subst().

00057     {
00058         assert (args.size() == arity());
00059         assert (types.size() == arity());
00060         
00061         return subst("\\log_{10}\\left( $0 \\right)", args[0]);
00062     }

Here is the call graph for this function:

virtual int Log10Prim::infereSigOrder ( const vector< int > &  args  )  [inline, virtual]

Implements xtended.

Definition at line 32 of file log10prim.cpp.

References arity().

00032                                                          {
00033         assert (args.size() == arity());
00034         return args[0];
00035     }

Here is the call graph for this function:

virtual Type Log10Prim::infereSigType ( const vector< Type > &  args  )  [inline, virtual]

Implements xtended.

Definition at line 19 of file log10prim.cpp.

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

00020     {
00021         assert (args.size() == arity());
00022         interval i = args[0]->getInterval();
00023         if (i.valid && (i.lo > 0)) {
00024             return castInterval(floatCast(args[0]), interval(log10(i.lo), log10(i.hi)));
00025         } else {
00026             return floatCast(args[0]);
00027         }
00028     }

Here is the call graph for this function:

virtual bool Log10Prim::needCache (  )  [inline, virtual]

Implements xtended.

Definition at line 17 of file log10prim.cpp.

00017 { return true; }

virtual void Log10Prim::sigVisit ( Tree  sig,
sigvisitor visitor 
) [inline, virtual]

Definition at line 30 of file log10prim.cpp.

00030 {}  


The documentation for this class was generated from the following file:
Generated on Thu Apr 29 00:00:20 2010 for FAUST compiler by  doxygen 1.6.3