LogPrim Class Reference

Inherits xtended.

Collaboration diagram for LogPrim:
[legend]

List of all members.

Public Member Functions

 LogPrim ()
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 7 of file logprim.cpp.


Constructor & Destructor Documentation

LogPrim::LogPrim (  )  [inline]

Definition at line 12 of file logprim.cpp.

00012 : xtended("log") {}


Member Function Documentation

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

Implements xtended.

Definition at line 14 of file logprim.cpp.

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

00014 { return 1; }

Here is the caller graph for this function:

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

Implements xtended.

Definition at line 37 of file logprim.cpp.

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

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

Here is the call graph for this function:

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

Implements xtended.

Definition at line 47 of file logprim.cpp.

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

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

Here is the call graph for this function:

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

Implements xtended.

Definition at line 55 of file logprim.cpp.

References arity(), and subst().

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

Here is the call graph for this function:

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

Implements xtended.

Definition at line 31 of file logprim.cpp.

References arity().

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

Here is the call graph for this function:

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

Implements xtended.

Definition at line 18 of file logprim.cpp.

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

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

Here is the call graph for this function:

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

Implements xtended.

Definition at line 16 of file logprim.cpp.

00016 { return true; }

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

Definition at line 29 of file logprim.cpp.

00029 {}  


The documentation for this class was generated from the following file:
Generated on Tue Aug 10 08:04:21 2010 for FAUST compiler by  doxygen 1.6.3