FAUST compiler  0.9.9.6b8
Public Member Functions
FmodPrim Class Reference
Inheritance diagram for FmodPrim:
Inheritance graph
[legend]
Collaboration diagram for FmodPrim:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 FmodPrim ()
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 fmodprim.cpp.


Constructor & Destructor Documentation

FmodPrim::FmodPrim ( ) [inline]

Definition at line 12 of file fmodprim.cpp.

: xtended("fmodf") {}

Member Function Documentation

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

Implements xtended.

Definition at line 14 of file fmodprim.cpp.

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

{ return 2; }

Here is the caller graph for this function:

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

Implements xtended.

Definition at line 32 of file fmodprim.cpp.

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

                                                                {
        num n,m;
        assert (args.size() == arity());
        if (isNum(args[0],n) & isNum(args[1],m)) {
            return tree(fmod(double(n), double(m)));
        } else {
            return tree(symbol(), args[0], args[1]);
        }
    }

Here is the call graph for this function:

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

Implements xtended.

Definition at line 42 of file fmodprim.cpp.

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

    {
        assert (args.size() == arity());
        assert (types.size() == arity());
        
        return subst("fmod$2($0,$1)", args[0], args[1], isuffix());
    }

Here is the call graph for this function:

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

Implements xtended.

Definition at line 50 of file fmodprim.cpp.

References arity(), and subst().

    {
        assert (args.size() == arity());
        assert (types.size() == arity());
        
        return subst("$0\\pmod{$1}", args[0], args[1]);
    }

Here is the call graph for this function:

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

Implements xtended.

Definition at line 26 of file fmodprim.cpp.

References arity(), and max().

                                                         {
        assert (args.size() == arity());
        return max(args[0], args[1]);
    }

Here is the call graph for this function:

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

Implements xtended.

Definition at line 18 of file fmodprim.cpp.

References arity(), and floatCast().

    {
        assert (args.size() == arity());
        return floatCast(args[0]|args[1]);
    }

Here is the call graph for this function:

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

Implements xtended.

Definition at line 16 of file fmodprim.cpp.

{ return true; }
virtual void FmodPrim::sigVisit ( Tree  sig,
sigvisitor visitor 
) [inline, virtual]

Definition at line 24 of file fmodprim.cpp.

{}  

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