Show
Ignore:
Timestamp:
02/16/09 10:02:08 (16 years ago)
Author:
smidl
Message:

Changes in the very root classes!
* rv and rvc are no longer compulsory,
* samplecond does not return ll
* BM has drv

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • doc/html/libFN_8h-source.html

    r269 r270  
    4242<a name="l00026"></a>00026                 <span class="comment">//vec eval() {return val;};</span> 
    4343<a name="l00028"></a><a class="code" href="classbdm_1_1constfn.html#33c2631ddcad9e81ef4b743d83eed4d4">00028</a> <span class="comment"></span>                vec <a class="code" href="classbdm_1_1constfn.html#33c2631ddcad9e81ef4b743d83eed4d4" title="inherited">eval</a> ( <span class="keyword">const</span> vec &amp;cond ) {<span class="keywordflow">return</span> val;}; 
    44 <a name="l00030"></a><a class="code" href="classbdm_1_1constfn.html#7df0693d3ef4f1d2a52a5a3c3fce44af">00030</a>                 <a class="code" href="classbdm_1_1constfn.html#7df0693d3ef4f1d2a52a5a3c3fce44af" title="Default constructor.">constfn</a> ( <span class="keyword">const</span> vec &amp;val0 ) :<a class="code" href="classbdm_1_1fnc.html" title="Class representing function  of variable  represented by rv.">fnc</a>(val0.length()), val ( val0 ) {}; 
     44<a name="l00030"></a><a class="code" href="classbdm_1_1constfn.html#7df0693d3ef4f1d2a52a5a3c3fce44af">00030</a>                 <a class="code" href="classbdm_1_1constfn.html#7df0693d3ef4f1d2a52a5a3c3fce44af" title="Default constructor.">constfn</a> ( <span class="keyword">const</span> vec &amp;val0 ) :<a class="code" href="classbdm_1_1fnc.html" title="Class representing function  of variable  represented by rv.">fnc</a>(), val ( val0 ) {<a class="code" href="classbdm_1_1fnc.html#52156cb4a52a62d51fc7455985797a62" title="Length of the output vector.">dimy</a>=val.length();}; 
    4545<a name="l00031"></a>00031 }; 
    4646<a name="l00032"></a>00032  
     
    5151<a name="l00041"></a>00041                 vec B; 
    5252<a name="l00042"></a>00042         <span class="keyword">public</span> : 
    53 <a name="l00043"></a><a class="code" href="classbdm_1_1linfn.html#b8063094a2aa210dcf7ae73e2b85e09c">00043</a>                 vec <a class="code" href="classbdm_1_1linfn.html#b8063094a2aa210dcf7ae73e2b85e09c" title="function evaluates numerical value of  at  cond ">eval</a> (<span class="keyword">const</span> vec &amp;cond ) {it_assert_debug ( cond.length() ==rv.<a class="code" href="classbdm_1_1RV.html#2174751a00ce19f941edd2c1a861be67" title="Return number of scalars in the RV.">count</a>(), <span class="stringliteral">"linfn::eval Wrong cond."</span> );<span class="keywordflow">return</span> A*cond+B;}; 
     53<a name="l00043"></a><a class="code" href="classbdm_1_1linfn.html#b8063094a2aa210dcf7ae73e2b85e09c">00043</a>                 vec <a class="code" href="classbdm_1_1linfn.html#b8063094a2aa210dcf7ae73e2b85e09c" title="function evaluates numerical value of  at  cond ">eval</a> (<span class="keyword">const</span> vec &amp;cond ) {it_assert_debug ( cond.length() ==rv.count(), <span class="stringliteral">"linfn::eval Wrong cond."</span> );<span class="keywordflow">return</span> A*cond+B;}; 
    5454<a name="l00044"></a>00044  
    5555<a name="l00045"></a>00045 <span class="comment">//              linfn evalsome ( ivec &amp;rvind );</span> 
    56 <a name="l00047"></a><a class="code" href="classbdm_1_1linfn.html#df4517947726204540735452a41206da">00047</a> <span class="comment"></span>                <a class="code" href="classbdm_1_1linfn.html#df4517947726204540735452a41206da" title="default constructor">linfn</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rv0 ) : <a class="code" href="classbdm_1_1fnc.html" title="Class representing function  of variable  represented by rv.">fnc</a>(rv0.count()), rv ( rv0 ),A ( eye ( rv0.count() ) ),B ( zeros ( rv0.count() ) ) { }; 
    57 <a name="l00049"></a><a class="code" href="classbdm_1_1linfn.html#7e0e714b814532fc3e38daede24c5e68">00049</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1linfn.html#7e0e714b814532fc3e38daede24c5e68" title="Set values of A and B.">set_parameters</a> ( <span class="keyword">const</span> mat &amp;A0 , <span class="keyword">const</span> vec &amp;B0 ) {A=A0; B=B0;}; 
     56<a name="l00047"></a><a class="code" href="classbdm_1_1linfn.html#b39c494c12863c031eb2acf86c0bc429">00047</a> <span class="comment"></span>                <a class="code" href="classbdm_1_1linfn.html#b39c494c12863c031eb2acf86c0bc429" title="default constructor">linfn</a> ( ) : <a class="code" href="classbdm_1_1fnc.html" title="Class representing function  of variable  represented by rv.">fnc</a>(), A ( ),B () { }; 
     57<a name="l00049"></a><a class="code" href="classbdm_1_1linfn.html#7e0e714b814532fc3e38daede24c5e68">00049</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1linfn.html#7e0e714b814532fc3e38daede24c5e68" title="Set values of A and B.">set_parameters</a> ( <span class="keyword">const</span> mat &amp;A0 , <span class="keyword">const</span> vec &amp;B0 ) {A=A0; B=B0; <a class="code" href="classbdm_1_1fnc.html#52156cb4a52a62d51fc7455985797a62" title="Length of the output vector.">dimy</a>=A.rows();}; 
    5858<a name="l00050"></a>00050 }; 
    5959<a name="l00051"></a>00051  
     
    7676<a name="l00084"></a><a class="code" href="classbdm_1_1diffbifn.html#651184f808a35f236dbfea21aca1b6ac">00084</a>                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1diffbifn.html#651184f808a35f236dbfea21aca1b6ac" title="Evaluates  and writes result into A .">dfdx_cond</a> ( <span class="keyword">const</span> vec &amp;x0, <span class="keyword">const</span> vec &amp;u0, mat &amp;A , <span class="keywordtype">bool</span> full=<span class="keyword">true</span> ) {}; 
    7777<a name="l00086"></a><a class="code" href="classbdm_1_1diffbifn.html#6ea1dc7a482601b29c5ba36a52d20d07">00086</a>                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1diffbifn.html#6ea1dc7a482601b29c5ba36a52d20d07" title="Evaluates  and writes result into A .">dfdu_cond</a> ( <span class="keyword">const</span> vec &amp;x0, <span class="keyword">const</span> vec &amp;u0, mat &amp;A, <span class="keywordtype">bool</span> full=<span class="keyword">true</span> ) {}; 
    78 <a name="l00088"></a><a class="code" href="classbdm_1_1diffbifn.html#6ecfa9bf42b2421bd56c260a8b2c51e1">00088</a>                 <a class="code" href="classbdm_1_1diffbifn.html#6ecfa9bf42b2421bd56c260a8b2c51e1" title="Default constructor (dimy is not set!).">diffbifn</a> (<span class="keywordtype">int</span> <a class="code" href="classbdm_1_1fnc.html#52156cb4a52a62d51fc7455985797a62" title="Length of the output vector.">dimy</a>, <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvx0, <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rvu0 ) : <a class="code" href="classbdm_1_1fnc.html" title="Class representing function  of variable  represented by rv.">fnc</a>(dimy), <a class="code" href="classbdm_1_1diffbifn.html#5f56547d8e9378b669d3cc19d7831cbb" title="Indentifier of the first rv.">rvx</a> ( rvx0 ),<a class="code" href="classbdm_1_1diffbifn.html#a8e3e861d5ec2a7ae9524e6338e58320" title="Indentifier of the second rv.">rvu</a> ( rvu0 ) {<a class="code" href="classbdm_1_1diffbifn.html#a193aa2c4a500139c0c4b669691e588e" title="cache for rvx.count()">dimx</a>=<a class="code" href="classbdm_1_1diffbifn.html#5f56547d8e9378b669d3cc19d7831cbb" title="Indentifier of the first rv.">rvx</a>.<a class="code" href="classbdm_1_1RV.html#2174751a00ce19f941edd2c1a861be67" title="Return number of scalars in the RV.">count</a>();<a class="code" href="classbdm_1_1diffbifn.html#30c45617eec89adeb4ebaa763d093fb0" title="cache for rvu.count()">dimu</a>=<a class="code" href="classbdm_1_1diffbifn.html#a8e3e861d5ec2a7ae9524e6338e58320" title="Indentifier of the second rv.">rvu</a>.<a class="code" href="classbdm_1_1RV.html#2174751a00ce19f941edd2c1a861be67" title="Return number of scalars in the RV.">count</a>();}; 
     78<a name="l00088"></a><a class="code" href="classbdm_1_1diffbifn.html#92ff29d748e445b440453a38d0b09681">00088</a>                 <a class="code" href="classbdm_1_1diffbifn.html#92ff29d748e445b440453a38d0b09681" title="Default constructor (dimy is not set!).">diffbifn</a> () : <a class="code" href="classbdm_1_1fnc.html" title="Class representing function  of variable  represented by rv.">fnc</a>() {}; 
    7979<a name="l00090"></a><a class="code" href="classbdm_1_1diffbifn.html#1b3c8f5949f13d86d2661e191d4b369b">00090</a>                 <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1diffbifn.html#1b3c8f5949f13d86d2661e191d4b369b" title="access function">_dimx</a>()<span class="keyword"> const</span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1diffbifn.html#a193aa2c4a500139c0c4b669691e588e" title="cache for rvx.count()">dimx</a>;} 
    8080<a name="l00092"></a><a class="code" href="classbdm_1_1diffbifn.html#031458f38c97cdb3aecde16f6a06dced">00092</a>                 <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1diffbifn.html#031458f38c97cdb3aecde16f6a06dced" title="access function">_dimu</a>()<span class="keyword"> const</span>{<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1diffbifn.html#30c45617eec89adeb4ebaa763d093fb0" title="cache for rvu.count()">dimu</a>;} 
     
    8989<a name="l00102"></a>00102                 vec <a class="code" href="classbdm_1_1bilinfn.html#e36a16e72e7f9fedf3cb18d2d5505a24" title="Evaluates .">eval</a> ( <span class="keyword">const</span>  vec &amp;x0, <span class="keyword">const</span> vec &amp;u0 ); 
    9090<a name="l00103"></a>00103  
    91 <a name="l00105"></a><a class="code" href="classbdm_1_1bilinfn.html#1e86e5081f13964ee64342f8e988032c">00105</a>                 <a class="code" href="classbdm_1_1bilinfn.html#1e86e5081f13964ee64342f8e988032c" title="Default constructor.">bilinfn</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvx0, <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvu0 ) : <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a> (<a class="code" href="classbdm_1_1diffbifn.html#a193aa2c4a500139c0c4b669691e588e" title="cache for rvx.count()">dimx</a>, rvx0,rvu0 ) ,A ( eye ( <a class="code" href="classbdm_1_1diffbifn.html#a193aa2c4a500139c0c4b669691e588e" title="cache for rvx.count()">dimx</a> ) ),B ( zeros ( <a class="code" href="classbdm_1_1diffbifn.html#a193aa2c4a500139c0c4b669691e588e" title="cache for rvx.count()">dimx</a>,<a class="code" href="classbdm_1_1diffbifn.html#30c45617eec89adeb4ebaa763d093fb0" title="cache for rvu.count()">dimu</a> ) )  {}; 
    92 <a name="l00107"></a>00107                 <a class="code" href="classbdm_1_1bilinfn.html#1e86e5081f13964ee64342f8e988032c" title="Default constructor.">bilinfn</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvx0, <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rvu0, <span class="keyword">const</span> mat &amp;A0, <span class="keyword">const</span> mat &amp;B0 ); 
    93 <a name="l00109"></a><a class="code" href="classbdm_1_1bilinfn.html#33066f1054dd259df2ec5fafae4b46e6">00109</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1bilinfn.html#33066f1054dd259df2ec5fafae4b46e6" title="Evaluates  and writes result into A .">dfdx_cond</a> ( <span class="keyword">const</span> vec &amp;x0, <span class="keyword">const</span> vec &amp;u0, mat &amp;F, <span class="keywordtype">bool</span> full ) 
    94 <a name="l00110"></a>00110                 { 
    95 <a name="l00111"></a>00111                         it_assert_debug ( ( F.cols() ==A.cols() ) &amp; ( F.rows() ==A.rows() ),<span class="stringliteral">"Allocated F is not compatible."</span> ); 
    96 <a name="l00112"></a>00112                         <span class="keywordflow">if</span> ( full ) F=A;        <span class="comment">//else : nothing has changed no need to regenerate</span> 
     91<a name="l00105"></a><a class="code" href="classbdm_1_1bilinfn.html#dc263f8d8d1876023a9d161d17a3c621">00105</a>                 <a class="code" href="classbdm_1_1bilinfn.html#dc263f8d8d1876023a9d161d17a3c621" title="Default constructor.">bilinfn</a> () : <a class="code" href="classbdm_1_1diffbifn.html" title="Class representing a differentiable function of two variables .">diffbifn</a> () ,A() ,B()      {}; 
     92<a name="l00107"></a><a class="code" href="classbdm_1_1bilinfn.html#5a508fbb5fc013904d9b62b2231442de">00107</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1bilinfn.html#5a508fbb5fc013904d9b62b2231442de" title="Alternative constructor.">set_parameters</a>(<span class="keyword">const</span> mat A0, <span class="keyword">const</span> mat B0){ 
     93<a name="l00108"></a>00108                         it_assert_debug(A0.rows()==B0.rows(),<span class="stringliteral">""</span>); 
     94<a name="l00109"></a>00109                         A=A0;B=B0; 
     95<a name="l00110"></a>00110                         <a class="code" href="classbdm_1_1fnc.html#52156cb4a52a62d51fc7455985797a62" title="Length of the output vector.">dimy</a>=A.rows(); 
     96<a name="l00111"></a>00111                         <a class="code" href="classbdm_1_1diffbifn.html#a193aa2c4a500139c0c4b669691e588e" title="cache for rvx.count()">dimx</a>=A.cols(); 
     97<a name="l00112"></a>00112                         <a class="code" href="classbdm_1_1diffbifn.html#30c45617eec89adeb4ebaa763d093fb0" title="cache for rvu.count()">dimu</a>=B.cols(); 
    9798<a name="l00113"></a>00113                 } 
    98 <a name="l00115"></a><a class="code" href="classbdm_1_1bilinfn.html#9cfe2f1c115ba7c3c75849a10a4f2c08">00115</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1bilinfn.html#9cfe2f1c115ba7c3c75849a10a4f2c08" title="Evaluates  and writes result into A .">dfdu_cond</a> ( <span class="keyword">const</span> vec &amp;x0, <span class="keyword">const</span> vec &amp;u0, mat &amp;F,  <span class="keywordtype">bool</span> full=<span class="keyword">true</span> ) 
     99<a name="l00115"></a><a class="code" href="classbdm_1_1bilinfn.html#33066f1054dd259df2ec5fafae4b46e6">00115</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1bilinfn.html#33066f1054dd259df2ec5fafae4b46e6" title="Evaluates  and writes result into A .">dfdx_cond</a> ( <span class="keyword">const</span> vec &amp;x0, <span class="keyword">const</span> vec &amp;u0, mat &amp;F, <span class="keywordtype">bool</span> full ) 
    99100<a name="l00116"></a>00116                 { 
    100 <a name="l00117"></a>00117                         it_assert_debug ( ( F.cols() ==B.cols() ) &amp; ( F.rows() ==B.rows() ),<span class="stringliteral">"Allocated F is not compatible."</span> ); 
    101 <a name="l00118"></a>00118                         <span class="keywordflow">if</span> ( full ) F=B;        <span class="comment">//else : nothing has changed no need to regenerate</span> 
     101<a name="l00117"></a>00117                         it_assert_debug ( ( F.cols() ==A.cols() ) &amp; ( F.rows() ==A.rows() ),<span class="stringliteral">"Allocated F is not compatible."</span> ); 
     102<a name="l00118"></a>00118                         <span class="keywordflow">if</span> ( full ) F=A;        <span class="comment">//else : nothing has changed no need to regenerate</span> 
    102103<a name="l00119"></a>00119                 } 
    103 <a name="l00120"></a>00120 }; 
    104 <a name="l00121"></a>00121  
    105 <a name="l00122"></a>00122 } <span class="comment">//namespace</span> 
    106 <a name="l00123"></a>00123 <span class="preprocessor">#endif // FN_H</span> 
     104<a name="l00121"></a><a class="code" href="classbdm_1_1bilinfn.html#9cfe2f1c115ba7c3c75849a10a4f2c08">00121</a>                 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1bilinfn.html#9cfe2f1c115ba7c3c75849a10a4f2c08" title="Evaluates  and writes result into A .">dfdu_cond</a> ( <span class="keyword">const</span> vec &amp;x0, <span class="keyword">const</span> vec &amp;u0, mat &amp;F,  <span class="keywordtype">bool</span> full=<span class="keyword">true</span> ) 
     105<a name="l00122"></a>00122                 { 
     106<a name="l00123"></a>00123                         it_assert_debug ( ( F.cols() ==B.cols() ) &amp; ( F.rows() ==B.rows() ),<span class="stringliteral">"Allocated F is not compatible."</span> ); 
     107<a name="l00124"></a>00124                         <span class="keywordflow">if</span> ( full ) F=B;        <span class="comment">//else : nothing has changed no need to regenerate</span> 
     108<a name="l00125"></a>00125                 } 
     109<a name="l00126"></a>00126 }; 
     110<a name="l00127"></a>00127  
     111<a name="l00128"></a>00128 } <span class="comment">//namespace</span> 
     112<a name="l00129"></a>00129 <span class="preprocessor">#endif // FN_H</span> 
    107113</pre></div></div> 
    108 <hr size="1"><address style="text-align: right;"><small>Generated on Wed Feb 11 10:20:05 2009 for mixpp by&nbsp; 
     114<hr size="1"><address style="text-align: right;"><small>Generated on Wed Feb 11 23:33:55 2009 for mixpp by&nbsp; 
    109115<a href="http://www.doxygen.org/index.html"> 
    110116<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>