AbsPrim Class Reference

Inherits xtended.

Collaboration diagram for AbsPrim:
[legend]

List of all members.

Public Member Functions

 AbsPrim ()
virtual unsigned int arity ()
virtual bool needCache ()
virtual Type infereSigType (const vector< Type > &types)
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 absprim.cpp.


Constructor & Destructor Documentation

AbsPrim::AbsPrim (  )  [inline]

Definition at line 6 of file absprim.cpp.

00008 : public xtended


Member Function Documentation

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

Implements xtended.

Definition at line 8 of file absprim.cpp.

Referenced by computeSigOutput(), and sigVisit().

00008 : public xtended

Here is the caller graph for this function:

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

Implements xtended.

Definition at line 29 of file absprim.cpp.

References arity().

00030     {
00031         assert (args.size() == arity());
00032         return args[0];
00033     }
00034 
00035 
00036     virtual Tree    computeSigOutput (const vector<Tree>& args)
00037     {
00038         double f; int i;
00039 
00040         assert (args.size() == arity());
00041 
00042         if (isDouble(args[0]->node(),&f)) {
00043             return tree(fabs(f));
00044 

Here is the call graph for this function:

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

Implements xtended.

Definition at line 46 of file absprim.cpp.

00048                {
00049             return tree(symbol(), args[0]);
00050         }
00051     }
00052 
00053     virtual string  generateCode (Klass* klass, const vector<string>& args, const vector<Type>& types)
00054     {
00055         assert (args.size() == arity());
00056         assert (types.size() == arity());
00057 

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

Implements xtended.

Definition at line 59 of file absprim.cpp.

References isuffix(), and subst().

00059                                   {
00060             return subst("fabs$1($0)", args[0], isuffix());
00061         } else {
00062             return subst("abs($0)", args[0]);
00063         }
00064     }
00065     
00066     virtual string  generateLateq (Lateq* lateq, const vector<string>& args, const vector<Type>& types)

Here is the call graph for this function:

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

Implements xtended.

Definition at line 22 of file absprim.cpp.

00027                                                              {}

virtual Type AbsPrim::infereSigType ( const vector< Type > &  types  )  [inline, virtual]

Implements xtended.

Definition at line 12 of file absprim.cpp.

00013               : xtended("abs") {}
00014 
00015     virtual unsigned int    arity () { return 1; }
00016 
00017     virtual bool    needCache ()    { return true; }
00018 

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

Implements xtended.

Definition at line 10 of file absprim.cpp.

00012 :

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

Definition at line 20 of file absprim.cpp.

References arity().

00020 {

Here is the call graph for this function:


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