<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>FAUST compiler: PowPrim Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.3 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> </div> <div class="contents"> <h1>PowPrim Class Reference</h1><!-- doxytag: class="PowPrim" --><!-- doxytag: inherits="xtended" --> <p>Inherits <a class="el" href="classxtended.html">xtended</a>.</p> <div class="dynheader"> Collaboration diagram for PowPrim:</div> <div class="dynsection"> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="classPowPrim-members.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classPowPrim.html#a637bb940adaf95328489301ef6fecf0c">PowPrim</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="classPowPrim.html#a8ffcae5e52dde9c8ffde9a7c2e3d97a7">arity</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classPowPrim.html#a07168f232166ad667ff247132fc1dc2d">needCache</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classP.html">Type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classPowPrim.html#a5f79c3b0d0d93d98f25b01ddb330fc30">infereSigType</a> (const vector< <a class="el" href="classP.html">Type</a> > &args)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classPowPrim.html#a7bcd5b3857f73e7afa54911204a9e416">sigVisit</a> (<a class="el" href="classCTree.html">Tree</a> sig, <a class="el" href="structsigvisitor.html">sigvisitor</a> *visitor)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="classPowPrim.html#ae01b4c0c8e35c8ed214bee38aae17642">infereSigOrder</a> (const vector< int > &args)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classCTree.html">Tree</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classPowPrim.html#a9788f3dc3f27ed6cd451affe86f493e5">computeSigOutput</a> (const vector< <a class="el" href="classCTree.html">Tree</a> > &args)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual string </td><td class="memItemRight" valign="bottom"><a class="el" href="classPowPrim.html#ae528ea350519e6ca31fc2df5d7307e19">generateCode</a> (<a class="el" href="classKlass.html">Klass</a> *klass, const vector< string > &args, const vector< <a class="el" href="classP.html">Type</a> > &types)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual string </td><td class="memItemRight" valign="bottom"><a class="el" href="classPowPrim.html#a45be4206339891ceeb1fd2960ed060fa">generateLateq</a> (<a class="el" href="classLateq.html">Lateq</a> *lateq, const vector< string > &args, const vector< <a class="el" href="classP.html">Type</a> > &types)</td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Definition at line <a class="el" href="powprim_8cpp_source.html#l00007">7</a> of file <a class="el" href="powprim_8cpp_source.html">powprim.cpp</a>.</p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a637bb940adaf95328489301ef6fecf0c"></a><!-- doxytag: member="PowPrim::PowPrim" ref="a637bb940adaf95328489301ef6fecf0c" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">PowPrim::PowPrim </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="powprim_8cpp_source.html#l00012">12</a> of file <a class="el" href="powprim_8cpp_source.html">powprim.cpp</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00012"></a>00012 : <a class="code" href="classxtended.html#ace763e408a3eae1f05e3dd2b36b1a7fb">xtended</a>(<span class="stringliteral">"powf"</span>) {} </pre></div></p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a8ffcae5e52dde9c8ffde9a7c2e3d97a7"></a><!-- doxytag: member="PowPrim::arity" ref="a8ffcae5e52dde9c8ffde9a7c2e3d97a7" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual unsigned int PowPrim::arity </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Implements <a class="el" href="classxtended.html#ad709963a78f1b630e44ff518134487b5">xtended</a>.</p> <p>Definition at line <a class="el" href="powprim_8cpp_source.html#l00014">14</a> of file <a class="el" href="powprim_8cpp_source.html">powprim.cpp</a>.</p> <p>Referenced by <a class="el" href="powprim_8cpp_source.html#l00032">computeSigOutput()</a>, <a class="el" href="powprim_8cpp_source.html#l00042">generateCode()</a>, <a class="el" href="powprim_8cpp_source.html#l00050">generateLateq()</a>, <a class="el" href="powprim_8cpp_source.html#l00026">infereSigOrder()</a>, and <a class="el" href="powprim_8cpp_source.html#l00018">infereSigType()</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00014"></a>00014 { <span class="keywordflow">return</span> 2; } </pre></div></p> <p><div class="dynheader"> Here is the caller graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="a9788f3dc3f27ed6cd451affe86f493e5"></a><!-- doxytag: member="PowPrim::computeSigOutput" ref="a9788f3dc3f27ed6cd451affe86f493e5" args="(const vector< Tree > &args)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="classCTree.html">Tree</a> PowPrim::computeSigOutput </td> <td>(</td> <td class="paramtype">const vector< <a class="el" href="classCTree.html">Tree</a> > & </td> <td class="paramname"> <em>args</em></td> <td> ) </td> <td><code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Implements <a class="el" href="classxtended.html#a0a088a599b3cdd9bcd1854446f145af8">xtended</a>.</p> <p>Definition at line <a class="el" href="powprim_8cpp_source.html#l00032">32</a> of file <a class="el" href="powprim_8cpp_source.html">powprim.cpp</a>.</p> <p>References <a class="el" href="powprim_8cpp_source.html#l00014">arity()</a>, <a class="el" href="signals_8hh_source.html#l00184">isNum()</a>, <a class="el" href="xtended_8hh_source.html#l00024">xtended::symbol()</a>, and <a class="el" href="tree_8hh_source.html#l00173">tree()</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00032"></a>00032 { <a name="l00033"></a>00033 <a class="code" href="classnum.html">num</a> n,m; <a name="l00034"></a>00034 assert (args.size() == <a class="code" href="classPowPrim.html#a8ffcae5e52dde9c8ffde9a7c2e3d97a7">arity</a>()); <a name="l00035"></a>00035 <span class="keywordflow">if</span> (<a class="code" href="signals_8hh.html#acd2773c99643a2dcc1c5409991c211e9">isNum</a>(args[0],n) & <a class="code" href="signals_8hh.html#acd2773c99643a2dcc1c5409991c211e9">isNum</a>(args[1],m)) { <a name="l00036"></a>00036 <span class="keywordflow">return</span> <a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(pow(<span class="keywordtype">double</span>(n), <span class="keywordtype">double</span>(m))); <a name="l00037"></a>00037 } <span class="keywordflow">else</span> { <a name="l00038"></a>00038 <span class="keywordflow">return</span> <a class="code" href="tree_8hh.html#a61c13e9361cfa80bbb3cd6ce60a8f595">tree</a>(<a class="code" href="classxtended.html#ae7e621bd8015110e7af77ab7c850f573">symbol</a>(), args[0], args[1]); <a name="l00039"></a>00039 } <a name="l00040"></a>00040 } </pre></div></p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="ae528ea350519e6ca31fc2df5d7307e19"></a><!-- doxytag: member="PowPrim::generateCode" ref="ae528ea350519e6ca31fc2df5d7307e19" args="(Klass *klass, const vector< string > &args, const vector< Type > &types)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual string PowPrim::generateCode </td> <td>(</td> <td class="paramtype"><a class="el" href="classKlass.html">Klass</a> * </td> <td class="paramname"> <em>klass</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const vector< string > & </td> <td class="paramname"> <em>args</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const vector< <a class="el" href="classP.html">Type</a> > & </td> <td class="paramname"> <em>types</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Implements <a class="el" href="classxtended.html#a859e32300d9ac541e961c222896ea3f9">xtended</a>.</p> <p>Definition at line <a class="el" href="powprim_8cpp_source.html#l00042">42</a> of file <a class="el" href="powprim_8cpp_source.html">powprim.cpp</a>.</p> <p>References <a class="el" href="powprim_8cpp_source.html#l00014">arity()</a>, <a class="el" href="floats_8cpp_source.html#l00043">isuffix()</a>, and <a class="el" href="Text_8cpp_source.html#l00060">subst()</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00043"></a>00043 { <a name="l00044"></a>00044 assert (args.size() == <a class="code" href="classPowPrim.html#a8ffcae5e52dde9c8ffde9a7c2e3d97a7">arity</a>()); <a name="l00045"></a>00045 assert (types.size() == <a class="code" href="classPowPrim.html#a8ffcae5e52dde9c8ffde9a7c2e3d97a7">arity</a>()); <a name="l00046"></a>00046 <a name="l00047"></a>00047 <span class="keywordflow">return</span> <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">"pow$2($0,$1)"</span>, args[0], args[1], <a class="code" href="floats_8cpp.html#a4091ebb0e4eff17b3ff908531df9fb92" title="suffix for math functions">isuffix</a>()); <a name="l00048"></a>00048 } </pre></div></p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="a45be4206339891ceeb1fd2960ed060fa"></a><!-- doxytag: member="PowPrim::generateLateq" ref="a45be4206339891ceeb1fd2960ed060fa" args="(Lateq *lateq, const vector< string > &args, const vector< Type > &types)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual string PowPrim::generateLateq </td> <td>(</td> <td class="paramtype"><a class="el" href="classLateq.html">Lateq</a> * </td> <td class="paramname"> <em>lateq</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const vector< string > & </td> <td class="paramname"> <em>args</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const vector< <a class="el" href="classP.html">Type</a> > & </td> <td class="paramname"> <em>types</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Implements <a class="el" href="classxtended.html#a25415adf523fa0494979380f2b1fa589">xtended</a>.</p> <p>Definition at line <a class="el" href="powprim_8cpp_source.html#l00050">50</a> of file <a class="el" href="powprim_8cpp_source.html">powprim.cpp</a>.</p> <p>References <a class="el" href="powprim_8cpp_source.html#l00014">arity()</a>, and <a class="el" href="Text_8cpp_source.html#l00060">subst()</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00051"></a>00051 { <a name="l00052"></a>00052 assert (args.size() == <a class="code" href="classPowPrim.html#a8ffcae5e52dde9c8ffde9a7c2e3d97a7">arity</a>()); <a name="l00053"></a>00053 assert (types.size() == <a class="code" href="classPowPrim.html#a8ffcae5e52dde9c8ffde9a7c2e3d97a7">arity</a>()); <a name="l00054"></a>00054 <a name="l00055"></a>00055 <span class="keywordflow">return</span> <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">"{$0}^{$1}"</span>, args[0], args[1]); <a name="l00056"></a>00056 } </pre></div></p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="ae01b4c0c8e35c8ed214bee38aae17642"></a><!-- doxytag: member="PowPrim::infereSigOrder" ref="ae01b4c0c8e35c8ed214bee38aae17642" args="(const vector< int > &args)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual int PowPrim::infereSigOrder </td> <td>(</td> <td class="paramtype">const vector< int > & </td> <td class="paramname"> <em>args</em></td> <td> ) </td> <td><code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Implements <a class="el" href="classxtended.html#a1f1bca3c6d30fd3878c8fbe372cd5387">xtended</a>.</p> <p>Definition at line <a class="el" href="powprim_8cpp_source.html#l00026">26</a> of file <a class="el" href="powprim_8cpp_source.html">powprim.cpp</a>.</p> <p>References <a class="el" href="powprim_8cpp_source.html#l00014">arity()</a>, and <a class="el" href="interval_8hh_source.html#l00060">max()</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00026"></a>00026 { <a name="l00027"></a>00027 assert (args.size() == <a class="code" href="classPowPrim.html#a8ffcae5e52dde9c8ffde9a7c2e3d97a7">arity</a>()); <a name="l00028"></a>00028 <span class="keywordflow">return</span> <a class="code" href="interval_8hh.html#a1c45761573e6cbc97cfacac78d905016">max</a>(args[0], args[1]); <a name="l00029"></a>00029 } </pre></div></p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="a5f79c3b0d0d93d98f25b01ddb330fc30"></a><!-- doxytag: member="PowPrim::infereSigType" ref="a5f79c3b0d0d93d98f25b01ddb330fc30" args="(const vector< Type > &args)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="classP.html">Type</a> PowPrim::infereSigType </td> <td>(</td> <td class="paramtype">const vector< <a class="el" href="classP.html">Type</a> > & </td> <td class="paramname"> <em>args</em></td> <td> ) </td> <td><code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Implements <a class="el" href="classxtended.html#a33f973979adf2dd4f7287590535e3c9f">xtended</a>.</p> <p>Definition at line <a class="el" href="powprim_8cpp_source.html#l00018">18</a> of file <a class="el" href="powprim_8cpp_source.html">powprim.cpp</a>.</p> <p>References <a class="el" href="powprim_8cpp_source.html#l00014">arity()</a>, <a class="el" href="sigtype_8hh_source.html#l00256">castInterval()</a>, and <a class="el" href="sigtype_8hh_source.html#l00248">floatCast()</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00019"></a>00019 { <a name="l00020"></a>00020 assert (args.size() == <a class="code" href="classPowPrim.html#a8ffcae5e52dde9c8ffde9a7c2e3d97a7">arity</a>()); <a name="l00021"></a>00021 <span class="keywordflow">return</span> <a class="code" href="sigtype_8hh.html#a4a00d24cc30a4924d2df9b56d577bd16">castInterval</a>(<a class="code" href="sigtype_8hh.html#a77cfb136d0b19316d3f95c700d4262f8">floatCast</a>(args[0]|args[1]), <a class="code" href="structinterval.html">interval</a>()); <span class="comment">// temporary !!!</span> <a name="l00022"></a>00022 } </pre></div></p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> </div> </p> </div> </div> <a class="anchor" id="a07168f232166ad667ff247132fc1dc2d"></a><!-- doxytag: member="PowPrim::needCache" ref="a07168f232166ad667ff247132fc1dc2d" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual bool PowPrim::needCache </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Implements <a class="el" href="classxtended.html#adf5e69b249396b41bf4d4d2a842a279b">xtended</a>.</p> <p>Definition at line <a class="el" href="powprim_8cpp_source.html#l00016">16</a> of file <a class="el" href="powprim_8cpp_source.html">powprim.cpp</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00016"></a>00016 { <span class="keywordflow">return</span> <span class="keyword">true</span>; } </pre></div></p> </div> </div> <a class="anchor" id="a7bcd5b3857f73e7afa54911204a9e416"></a><!-- doxytag: member="PowPrim::sigVisit" ref="a7bcd5b3857f73e7afa54911204a9e416" args="(Tree sig, sigvisitor *visitor)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual void PowPrim::sigVisit </td> <td>(</td> <td class="paramtype"><a class="el" href="classCTree.html">Tree</a> </td> <td class="paramname"> <em>sig</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="structsigvisitor.html">sigvisitor</a> * </td> <td class="paramname"> <em>visitor</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="powprim_8cpp_source.html#l00024">24</a> of file <a class="el" href="powprim_8cpp_source.html">powprim.cpp</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00024"></a>00024 {} </pre></div></p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="powprim_8cpp_source.html">powprim.cpp</a></li> </ul> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Apr 29 00:00:22 2010 for FAUST compiler by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address> </body> </html>