Index: library/doc/html/emix_8h_source.html
===================================================================
--- library/doc/html/emix_8h_source.html (revision 656)
+++ library/doc/html/emix_8h_source.html (revision 661)
@@ -114,5 +114,5 @@
 <a name="l00078"></a>00078                 vec nom_val ( dimension() + <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> );
 <a name="l00079"></a>00079                 <a class="code" href="classbdm_1_1mratio.html#acda5bd23ba60146d69e1f804ff7710c7" title="datalink between conditional and nom">dl</a>.<a class="code" href="classbdm_1_1datalink__m2e.html#ab29bc3c7bf2a1d87e77ccaa793d097d5" title="Copy corresponding values to Up.condition.">pushup_cond</a> ( nom_val, val, cond );
-<a name="l00080"></a>00080                 tmp = exp ( <a class="code" href="classbdm_1_1mratio.html#af31caba90a2aa10fbf7631832404fe54" title="Nominator in the form of mpdf.">nom</a>-&gt;<a class="code" href="classbdm_1_1epdf.html#adeab266d63c236c277538867d5c3f249" title="Compute log-probability of argument val In case the argument is out of suport return...">evallog</a> ( nom_val ) - <a class="code" href="classbdm_1_1mratio.html#a873598797f36eddab44e342e14563fcb" title="Denominator in the form of epdf.">den</a>-&gt;evallog ( cond ) );
+<a name="l00080"></a>00080                 tmp = exp ( <a class="code" href="classbdm_1_1mratio.html#af31caba90a2aa10fbf7631832404fe54" title="Nominator in the form of mpdf.">nom</a>-&gt;<a class="code" href="classbdm_1_1epdf.html#adeab266d63c236c277538867d5c3f249">evallog</a> ( nom_val ) - <a class="code" href="classbdm_1_1mratio.html#a873598797f36eddab44e342e14563fcb" title="Denominator in the form of epdf.">den</a>-&gt;evallog ( cond ) );
 <a name="l00081"></a>00081                 <span class="keywordflow">return</span> tmp;
 <a name="l00082"></a>00082         }
@@ -161,9 +161,9 @@
 <a name="l00146"></a>00146                 <span class="keywordflow">return</span> mom2 - pow ( <a class="code" href="classbdm_1_1emix.html#aa3a5390bc56e81ef3b0debc0f185fa8a" title="return expected value">mean</a>(), 2 );
 <a name="l00147"></a>00147         }
-<a name="l00148"></a><a class="code" href="classbdm_1_1emix.html#a0f3db99f730bde6b7953931594537e8e">00148</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1emix.html#a0f3db99f730bde6b7953931594537e8e" title="Compute log-probability of argument val In case the argument is out of suport return...">evallog</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const </span>{
+<a name="l00148"></a><a class="code" href="classbdm_1_1emix.html#a0f3db99f730bde6b7953931594537e8e">00148</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1emix.html#a0f3db99f730bde6b7953931594537e8e">evallog</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const </span>{
 <a name="l00149"></a>00149                 <span class="keywordtype">int</span> i;
 <a name="l00150"></a>00150                 <span class="keywordtype">double</span> sum = 0.0;
 <a name="l00151"></a>00151                 <span class="keywordflow">for</span> ( i = 0; i &lt; <a class="code" href="classbdm_1_1emix.html#abb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a>.length(); i++ ) {
-<a name="l00152"></a>00152                         sum += <a class="code" href="classbdm_1_1emix.html#abb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a> ( i ) * exp ( <a class="code" href="classbdm_1_1emix.html#a866e75dacba151942ead95104e57a897" title="Component (epdfs).">Coms</a> ( i )-&gt;<a class="code" href="classbdm_1_1emix.html#a0f3db99f730bde6b7953931594537e8e" title="Compute log-probability of argument val In case the argument is out of suport return...">evallog</a> ( val ) );
+<a name="l00152"></a>00152                         sum += <a class="code" href="classbdm_1_1emix.html#abb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a> ( i ) * exp ( <a class="code" href="classbdm_1_1emix.html#a866e75dacba151942ead95104e57a897" title="Component (epdfs).">Coms</a> ( i )-&gt;<a class="code" href="classbdm_1_1emix.html#a0f3db99f730bde6b7953931594537e8e">evallog</a> ( val ) );
 <a name="l00153"></a>00153                 }
 <a name="l00154"></a>00154                 <span class="keywordflow">if</span> ( sum == 0.0 ) {
@@ -237,226 +237,226 @@
 <a name="l00239"></a>00239 
 <a name="l00240"></a>00240         <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;epdf&gt;</a> <a class="code" href="classbdm_1_1egiwmix.html#aab30611d0ca7cc718956548a42a1f67d" title="Return marginal density on the given RV, the remainig rvs are intergrated out.">marginal</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;<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> ) <span class="keyword">const</span>;
-<a name="l00241"></a>00241         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1egiwmix.html#aab30611d0ca7cc718956548a42a1f67d" title="Return marginal density on the given RV, the remainig rvs are intergrated out.">marginal</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;<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>, <a class="code" href="classbdm_1_1emix.html" title="Mixture of epdfs.">emix</a> &amp;target ) <span class="keyword">const</span>;
-<a name="l00242"></a>00242 
-<a name="l00243"></a>00243 <span class="comment">//Access methods</span>
-<a name="l00245"></a><a class="code" href="classbdm_1_1egiwmix.html#a884d203ca3994b9fba4c8bd440f355ea">00245</a> <span class="comment"></span>        vec&amp; <a class="code" href="classbdm_1_1egiwmix.html#a884d203ca3994b9fba4c8bd440f355ea" title="returns a pointer to the internal mean value. Use with Care!">_w</a>() {
-<a name="l00246"></a>00246                 <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1egiwmix.html#a2deb6d7cd689949b92450227de98afa4" title="weights of the components">w</a>;
-<a name="l00247"></a>00247         }
-<a name="l00248"></a>00248         <span class="keyword">virtual</span> ~<a class="code" href="classbdm_1_1egiwmix.html" title="Mixture of egiws.">egiwmix</a>() {
-<a name="l00249"></a>00249                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1egiwmix.html#a2a363169e5aa6c7cad1f4d7647fe9eec" title="Flag if owning Coms.">destroyComs</a> ) {
-<a name="l00250"></a>00250                         <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1egiwmix.html#a8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a>.length(); i++ ) {
-<a name="l00251"></a>00251                                 <span class="keyword">delete</span> <a class="code" href="classbdm_1_1egiwmix.html#a8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a> ( i );
-<a name="l00252"></a>00252                         }
-<a name="l00253"></a>00253                 }
-<a name="l00254"></a>00254         }
-<a name="l00256"></a><a class="code" href="classbdm_1_1egiwmix.html#aadc550fe74df25524c20867e89b5b096">00256</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1egiwmix.html#aadc550fe74df25524c20867e89b5b096" title="Auxiliary function for taking ownership of the Coms().">ownComs</a>() {
-<a name="l00257"></a>00257                 <a class="code" href="classbdm_1_1egiwmix.html#a2a363169e5aa6c7cad1f4d7647fe9eec" title="Flag if owning Coms.">destroyComs</a> = <span class="keyword">true</span>;
-<a name="l00258"></a>00258         }
-<a name="l00259"></a>00259 
-<a name="l00261"></a><a class="code" href="classbdm_1_1egiwmix.html#ad20a56a7b129c1ea9f71725e15f8ad8c">00261</a>         <a class="code" href="classbdm_1_1egiw.html" title="Gauss-inverse-Wishart density stored in LD form.">egiw</a>* <a class="code" href="classbdm_1_1egiwmix.html#ad20a56a7b129c1ea9f71725e15f8ad8c" title="access function">_Coms</a> ( <span class="keywordtype">int</span> i ) {
-<a name="l00262"></a>00262                 <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1egiwmix.html#a8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a> ( i );
-<a name="l00263"></a>00263         }
-<a name="l00264"></a>00264 
-<a name="l00265"></a><a class="code" href="classbdm_1_1egiwmix.html#adc999c5c1402c450200f22128db688b2">00265</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1egiwmix.html#adc999c5c1402c450200f22128db688b2" title="Name its rv.">set_rv</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;<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> ) {
-<a name="l00266"></a>00266                 <a class="code" href="classbdm_1_1egiwmix.html#adc999c5c1402c450200f22128db688b2" title="Name its rv.">egiw::set_rv</a> ( rv );
-<a name="l00267"></a>00267                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1egiwmix.html#a8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a>.length(); i++ ) {
-<a name="l00268"></a>00268                         <a class="code" href="classbdm_1_1egiwmix.html#a8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a> ( i )-&gt;set_rv ( rv );
-<a name="l00269"></a>00269                 }
-<a name="l00270"></a>00270         }
-<a name="l00271"></a>00271 
-<a name="l00273"></a>00273         <a class="code" href="classbdm_1_1egiw.html" title="Gauss-inverse-Wishart density stored in LD form.">egiw</a>* <a class="code" href="classbdm_1_1egiwmix.html#a10894d50e82130cc5b93d3cbc30b2e4d" title="Approximation of a GiW mix by a single GiW pdf.">approx</a>();
-<a name="l00274"></a>00274 };
-<a name="l00275"></a>00275 
-<a name="l00284"></a><a class="code" href="classbdm_1_1mprod.html">00284</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mprod.html" title="Chain rule decomposition of epdf.">mprod</a>: <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling , where  is random variable, rv, and...">mpdf</a> {
-<a name="l00285"></a>00285 <span class="keyword">private</span>:
-<a name="l00286"></a>00286         Array&lt;shared_ptr&lt;mpdf&gt; &gt; mpdfs;
-<a name="l00287"></a>00287 
-<a name="l00289"></a>00289         Array&lt;shared_ptr&lt;datalink_m2m&gt; &gt; dls;
-<a name="l00290"></a>00290 
-<a name="l00291"></a>00291 <span class="keyword">protected</span>:
-<a name="l00293"></a><a class="code" href="classbdm_1_1mprod.html#a9dab8448f970e2e09f76d14af990990d">00293</a>         <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> <a class="code" href="classbdm_1_1mprod.html#a9dab8448f970e2e09f76d14af990990d" title="dummy epdf used only as storage for RV and dim">iepdf</a>;
-<a name="l00294"></a>00294 
-<a name="l00295"></a>00295 <span class="keyword">public</span>:
-<a name="l00297"></a><a class="code" href="classbdm_1_1mprod.html#afed864cdd0e724d9133e6c6bfcacf94b">00297</a>         <a class="code" href="classbdm_1_1mprod.html#afed864cdd0e724d9133e6c6bfcacf94b" title="Default constructor.">mprod</a>() { }
-<a name="l00298"></a>00298 
-<a name="l00301"></a><a class="code" href="classbdm_1_1mprod.html#ae0d61b25fa0955b2c5fab8c710c42200">00301</a>         <a class="code" href="classbdm_1_1mprod.html#ae0d61b25fa0955b2c5fab8c710c42200" title="Constructor from list of mFacs.">mprod</a> ( <span class="keyword">const</span> Array&lt;<a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;mpdf&gt;</a> &gt; &amp;mFacs ) {
-<a name="l00302"></a>00302                 <a class="code" href="classbdm_1_1mprod.html#aacb4cd6d390ef73a4432d0c4993baffa" title="Set internal mpdfs from given values.">set_elements</a> ( mFacs );
-<a name="l00303"></a>00303         }
-<a name="l00305"></a>00305         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mprod.html#aacb4cd6d390ef73a4432d0c4993baffa" title="Set internal mpdfs from given values.">set_elements</a> (<span class="keyword">const</span> Array&lt;<a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;mpdf&gt;</a> &gt; &amp;mFacs );
-<a name="l00306"></a>00306 
-<a name="l00307"></a><a class="code" href="classbdm_1_1mprod.html#a800f21d94c919137608a2fd5c88719e2">00307</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mprod.html#a800f21d94c919137608a2fd5c88719e2" title="Shortcut for conditioning and evaluation of the internal epdf. In some cases, this...">evallogcond</a> ( <span class="keyword">const</span> vec &amp;val, <span class="keyword">const</span> vec &amp;cond ) {
-<a name="l00308"></a>00308                 <span class="keywordtype">int</span> i;
-<a name="l00309"></a>00309                 <span class="keywordtype">double</span> res = 0.0;
-<a name="l00310"></a>00310                 <span class="keywordflow">for</span> ( i = mpdfs.length() - 1; i &gt;= 0; i-- ) {
-<a name="l00311"></a>00311                         <span class="comment">/*                      if ( mpdfs(i)-&gt;_rvc().count() &gt;0) {</span>
-<a name="l00312"></a>00312 <span class="comment">                                                        mpdfs ( i )-&gt;condition ( dls ( i )-&gt;get_cond ( val,cond ) );</span>
-<a name="l00313"></a>00313 <span class="comment">                                                }</span>
-<a name="l00314"></a>00314 <span class="comment">                                                // add logarithms</span>
-<a name="l00315"></a>00315 <span class="comment">                                                res += epdfs ( i )-&gt;evallog ( dls ( i )-&gt;pushdown ( val ) );*/</span>
-<a name="l00316"></a>00316                         res += mpdfs ( i )-&gt;evallogcond (
-<a name="l00317"></a>00317                                    dls ( i )-&gt;pushdown ( val ),
-<a name="l00318"></a>00318                                    dls ( i )-&gt;get_cond ( val, cond )
-<a name="l00319"></a>00319                                );
-<a name="l00320"></a>00320                 }
-<a name="l00321"></a>00321                 <span class="keywordflow">return</span> res;
-<a name="l00322"></a>00322         }
-<a name="l00323"></a><a class="code" href="classbdm_1_1mprod.html#ae27b359d2572abfa4cc7d8f947848dab">00323</a>         vec <a class="code" href="classbdm_1_1mprod.html#ae27b359d2572abfa4cc7d8f947848dab" title="Matrix version of evallogcond.">evallogcond_m</a> ( <span class="keyword">const</span> mat &amp;Dt, <span class="keyword">const</span> vec &amp;cond ) {
-<a name="l00324"></a>00324                 vec tmp ( Dt.cols() );
-<a name="l00325"></a>00325                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; Dt.cols(); i++ ) {
-<a name="l00326"></a>00326                         tmp ( i ) = <a class="code" href="classbdm_1_1mprod.html#a800f21d94c919137608a2fd5c88719e2" title="Shortcut for conditioning and evaluation of the internal epdf. In some cases, this...">evallogcond</a> ( Dt.get_col ( i ), cond );
-<a name="l00327"></a>00327                 }
-<a name="l00328"></a>00328                 <span class="keywordflow">return</span> tmp;
-<a name="l00329"></a>00329         };
-<a name="l00330"></a><a class="code" href="classbdm_1_1mprod.html#ae8cdde6056fe20551be1fa460841f5e2">00330</a>         vec <a class="code" href="classbdm_1_1mprod.html#ae8cdde6056fe20551be1fa460841f5e2" title="Array&amp;lt;vec&amp;gt; version of evallogcond.">evallogcond_m</a> ( <span class="keyword">const</span> Array&lt;vec&gt; &amp;Dt, <span class="keyword">const</span> vec &amp;cond ) {
-<a name="l00331"></a>00331                 vec tmp ( Dt.length() );
-<a name="l00332"></a>00332                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; Dt.length(); i++ ) {
-<a name="l00333"></a>00333                         tmp ( i ) = <a class="code" href="classbdm_1_1mprod.html#a800f21d94c919137608a2fd5c88719e2" title="Shortcut for conditioning and evaluation of the internal epdf. In some cases, this...">evallogcond</a> ( Dt ( i ), cond );
-<a name="l00334"></a>00334                 }
-<a name="l00335"></a>00335                 <span class="keywordflow">return</span> tmp;
-<a name="l00336"></a>00336         };
-<a name="l00337"></a>00337 
+<a name="l00242"></a>00242         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1egiwmix.html#aab30611d0ca7cc718956548a42a1f67d" title="Return marginal density on the given RV, the remainig rvs are intergrated out.">marginal</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;<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>, <a class="code" href="classbdm_1_1emix.html" title="Mixture of epdfs.">emix</a> &amp;target ) <span class="keyword">const</span>;
+<a name="l00243"></a>00243 
+<a name="l00244"></a>00244 <span class="comment">//Access methods</span>
+<a name="l00246"></a><a class="code" href="classbdm_1_1egiwmix.html#a884d203ca3994b9fba4c8bd440f355ea">00246</a> <span class="comment"></span>        vec&amp; <a class="code" href="classbdm_1_1egiwmix.html#a884d203ca3994b9fba4c8bd440f355ea" title="returns a pointer to the internal mean value. Use with Care!">_w</a>() {
+<a name="l00247"></a>00247                 <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1egiwmix.html#a2deb6d7cd689949b92450227de98afa4" title="weights of the components">w</a>;
+<a name="l00248"></a>00248         }
+<a name="l00249"></a>00249         <span class="keyword">virtual</span> ~<a class="code" href="classbdm_1_1egiwmix.html" title="Mixture of egiws.">egiwmix</a>() {
+<a name="l00250"></a>00250                 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1egiwmix.html#a2a363169e5aa6c7cad1f4d7647fe9eec" title="Flag if owning Coms.">destroyComs</a> ) {
+<a name="l00251"></a>00251                         <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1egiwmix.html#a8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a>.length(); i++ ) {
+<a name="l00252"></a>00252                                 <span class="keyword">delete</span> <a class="code" href="classbdm_1_1egiwmix.html#a8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a> ( i );
+<a name="l00253"></a>00253                         }
+<a name="l00254"></a>00254                 }
+<a name="l00255"></a>00255         }
+<a name="l00257"></a><a class="code" href="classbdm_1_1egiwmix.html#aadc550fe74df25524c20867e89b5b096">00257</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1egiwmix.html#aadc550fe74df25524c20867e89b5b096" title="Auxiliary function for taking ownership of the Coms().">ownComs</a>() {
+<a name="l00258"></a>00258                 <a class="code" href="classbdm_1_1egiwmix.html#a2a363169e5aa6c7cad1f4d7647fe9eec" title="Flag if owning Coms.">destroyComs</a> = <span class="keyword">true</span>;
+<a name="l00259"></a>00259         }
+<a name="l00260"></a>00260 
+<a name="l00262"></a><a class="code" href="classbdm_1_1egiwmix.html#ad20a56a7b129c1ea9f71725e15f8ad8c">00262</a>         <a class="code" href="classbdm_1_1egiw.html" title="Gauss-inverse-Wishart density stored in LD form.">egiw</a>* <a class="code" href="classbdm_1_1egiwmix.html#ad20a56a7b129c1ea9f71725e15f8ad8c" title="access function">_Coms</a> ( <span class="keywordtype">int</span> i ) {
+<a name="l00263"></a>00263                 <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1egiwmix.html#a8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a> ( i );
+<a name="l00264"></a>00264         }
+<a name="l00265"></a>00265 
+<a name="l00266"></a><a class="code" href="classbdm_1_1egiwmix.html#adc999c5c1402c450200f22128db688b2">00266</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1egiwmix.html#adc999c5c1402c450200f22128db688b2" title="Name its rv.">set_rv</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;<a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> ) {
+<a name="l00267"></a>00267                 <a class="code" href="classbdm_1_1egiwmix.html#adc999c5c1402c450200f22128db688b2" title="Name its rv.">egiw::set_rv</a> ( rv );
+<a name="l00268"></a>00268                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1egiwmix.html#a8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a>.length(); i++ ) {
+<a name="l00269"></a>00269                         <a class="code" href="classbdm_1_1egiwmix.html#a8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a> ( i )-&gt;set_rv ( rv );
+<a name="l00270"></a>00270                 }
+<a name="l00271"></a>00271         }
+<a name="l00272"></a>00272 
+<a name="l00274"></a>00274         <a class="code" href="classbdm_1_1egiw.html" title="Gauss-inverse-Wishart density stored in LD form.">egiw</a>* <a class="code" href="classbdm_1_1egiwmix.html#a10894d50e82130cc5b93d3cbc30b2e4d" title="Approximation of a GiW mix by a single GiW pdf.">approx</a>();
+<a name="l00275"></a>00275 };
+<a name="l00276"></a>00276 
+<a name="l00285"></a><a class="code" href="classbdm_1_1mprod.html">00285</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mprod.html" title="Chain rule decomposition of epdf.">mprod</a>: <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling , where  is random variable, rv, and...">mpdf</a> {
+<a name="l00286"></a>00286 <span class="keyword">private</span>:
+<a name="l00287"></a>00287         Array&lt;shared_ptr&lt;mpdf&gt; &gt; mpdfs;
+<a name="l00288"></a>00288 
+<a name="l00290"></a>00290         Array&lt;shared_ptr&lt;datalink_m2m&gt; &gt; dls;
+<a name="l00291"></a>00291 
+<a name="l00292"></a>00292 <span class="keyword">protected</span>:
+<a name="l00294"></a><a class="code" href="classbdm_1_1mprod.html#a9dab8448f970e2e09f76d14af990990d">00294</a>         <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> <a class="code" href="classbdm_1_1mprod.html#a9dab8448f970e2e09f76d14af990990d" title="dummy epdf used only as storage for RV and dim">iepdf</a>;
+<a name="l00295"></a>00295 
+<a name="l00296"></a>00296 <span class="keyword">public</span>:
+<a name="l00298"></a><a class="code" href="classbdm_1_1mprod.html#afed864cdd0e724d9133e6c6bfcacf94b">00298</a>         <a class="code" href="classbdm_1_1mprod.html#afed864cdd0e724d9133e6c6bfcacf94b" title="Default constructor.">mprod</a>() { }
+<a name="l00299"></a>00299 
+<a name="l00302"></a><a class="code" href="classbdm_1_1mprod.html#ae0d61b25fa0955b2c5fab8c710c42200">00302</a>         <a class="code" href="classbdm_1_1mprod.html#ae0d61b25fa0955b2c5fab8c710c42200" title="Constructor from list of mFacs.">mprod</a> ( <span class="keyword">const</span> Array&lt;<a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;mpdf&gt;</a> &gt; &amp;mFacs ) {
+<a name="l00303"></a>00303                 <a class="code" href="classbdm_1_1mprod.html#aacb4cd6d390ef73a4432d0c4993baffa" title="Set internal mpdfs from given values.">set_elements</a> ( mFacs );
+<a name="l00304"></a>00304         }
+<a name="l00306"></a>00306         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mprod.html#aacb4cd6d390ef73a4432d0c4993baffa" title="Set internal mpdfs from given values.">set_elements</a> (<span class="keyword">const</span> Array&lt;<a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;mpdf&gt;</a> &gt; &amp;mFacs );
+<a name="l00307"></a>00307 
+<a name="l00308"></a><a class="code" href="classbdm_1_1mprod.html#a800f21d94c919137608a2fd5c88719e2">00308</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mprod.html#a800f21d94c919137608a2fd5c88719e2" title="Shortcut for conditioning and evaluation of the internal epdf. In some cases, this...">evallogcond</a> ( <span class="keyword">const</span> vec &amp;val, <span class="keyword">const</span> vec &amp;cond ) {
+<a name="l00309"></a>00309                 <span class="keywordtype">int</span> i;
+<a name="l00310"></a>00310                 <span class="keywordtype">double</span> res = 0.0;
+<a name="l00311"></a>00311                 <span class="keywordflow">for</span> ( i = mpdfs.length() - 1; i &gt;= 0; i-- ) {
+<a name="l00312"></a>00312                         <span class="comment">/*                      if ( mpdfs(i)-&gt;_rvc().count() &gt;0) {</span>
+<a name="l00313"></a>00313 <span class="comment">                                                        mpdfs ( i )-&gt;condition ( dls ( i )-&gt;get_cond ( val,cond ) );</span>
+<a name="l00314"></a>00314 <span class="comment">                                                }</span>
+<a name="l00315"></a>00315 <span class="comment">                                                // add logarithms</span>
+<a name="l00316"></a>00316 <span class="comment">                                                res += epdfs ( i )-&gt;evallog ( dls ( i )-&gt;pushdown ( val ) );*/</span>
+<a name="l00317"></a>00317                         res += mpdfs ( i )-&gt;evallogcond (
+<a name="l00318"></a>00318                                    dls ( i )-&gt;pushdown ( val ),
+<a name="l00319"></a>00319                                    dls ( i )-&gt;get_cond ( val, cond )
+<a name="l00320"></a>00320                                );
+<a name="l00321"></a>00321                 }
+<a name="l00322"></a>00322                 <span class="keywordflow">return</span> res;
+<a name="l00323"></a>00323         }
+<a name="l00324"></a><a class="code" href="classbdm_1_1mprod.html#ae27b359d2572abfa4cc7d8f947848dab">00324</a>         vec <a class="code" href="classbdm_1_1mprod.html#ae27b359d2572abfa4cc7d8f947848dab" title="Matrix version of evallogcond.">evallogcond_m</a> ( <span class="keyword">const</span> mat &amp;Dt, <span class="keyword">const</span> vec &amp;cond ) {
+<a name="l00325"></a>00325                 vec tmp ( Dt.cols() );
+<a name="l00326"></a>00326                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; Dt.cols(); i++ ) {
+<a name="l00327"></a>00327                         tmp ( i ) = <a class="code" href="classbdm_1_1mprod.html#a800f21d94c919137608a2fd5c88719e2" title="Shortcut for conditioning and evaluation of the internal epdf. In some cases, this...">evallogcond</a> ( Dt.get_col ( i ), cond );
+<a name="l00328"></a>00328                 }
+<a name="l00329"></a>00329                 <span class="keywordflow">return</span> tmp;
+<a name="l00330"></a>00330         };
+<a name="l00331"></a><a class="code" href="classbdm_1_1mprod.html#ae8cdde6056fe20551be1fa460841f5e2">00331</a>         vec <a class="code" href="classbdm_1_1mprod.html#ae8cdde6056fe20551be1fa460841f5e2" title="Array&amp;lt;vec&amp;gt; version of evallogcond.">evallogcond_m</a> ( <span class="keyword">const</span> Array&lt;vec&gt; &amp;Dt, <span class="keyword">const</span> vec &amp;cond ) {
+<a name="l00332"></a>00332                 vec tmp ( Dt.length() );
+<a name="l00333"></a>00333                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; Dt.length(); i++ ) {
+<a name="l00334"></a>00334                         tmp ( i ) = <a class="code" href="classbdm_1_1mprod.html#a800f21d94c919137608a2fd5c88719e2" title="Shortcut for conditioning and evaluation of the internal epdf. In some cases, this...">evallogcond</a> ( Dt ( i ), cond );
+<a name="l00335"></a>00335                 }
+<a name="l00336"></a>00336                 <span class="keywordflow">return</span> tmp;
+<a name="l00337"></a>00337         };
 <a name="l00338"></a>00338 
-<a name="l00339"></a>00339         <span class="comment">//TODO smarter...</span>
-<a name="l00340"></a><a class="code" href="classbdm_1_1mprod.html#aee715a8013acf9892f6cb489db595555">00340</a>         vec <a class="code" href="classbdm_1_1mprod.html#aee715a8013acf9892f6cb489db595555" title="Returns a sample from the density conditioned on cond, .">samplecond</a> ( <span class="keyword">const</span> vec &amp;cond ) {
-<a name="l00342"></a>00342                 vec smp = std::numeric_limits&lt;double&gt;::infinity() * ones ( dimension() );
-<a name="l00343"></a>00343                 vec smpi;
-<a name="l00344"></a>00344                 <span class="comment">// Hard assumption here!!! We are going backwards, to assure that samples that are needed from smp are already generated!</span>
-<a name="l00345"></a>00345                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = ( mpdfs.length() - 1 ); i &gt;= 0; i-- ) {
-<a name="l00346"></a>00346                         <span class="comment">// generate contribution of this mpdf</span>
-<a name="l00347"></a>00347                         smpi = mpdfs(i)-&gt;samplecond(dls ( i )-&gt;get_cond ( smp , cond ));                        
-<a name="l00348"></a>00348                         <span class="comment">// copy contribution of this pdf into smp</span>
-<a name="l00349"></a>00349                         dls ( i )-&gt;pushup ( smp, smpi );
-<a name="l00350"></a>00350                 }
-<a name="l00351"></a>00351                 <span class="keywordflow">return</span> smp;
-<a name="l00352"></a>00352         }
-<a name="l00353"></a>00353 
-<a name="l00361"></a><a class="code" href="classbdm_1_1mprod.html#abfa7478f8df1de6d8cd4c349db512831">00361</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mprod.html#abfa7478f8df1de6d8cd4c349db512831">from_setting</a> ( <span class="keyword">const</span> Setting &amp;<span class="keyword">set</span> ) {
-<a name="l00362"></a>00362                 Array&lt;shared_ptr&lt;mpdf&gt; &gt; atmp; <span class="comment">//temporary Array</span>
-<a name="l00363"></a>00363                 <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> ( atmp, <span class="keyword">set</span>, <span class="stringliteral">&quot;mpdfs&quot;</span>, UI::compulsory );
-<a name="l00364"></a>00364                 <a class="code" href="classbdm_1_1mprod.html#aacb4cd6d390ef73a4432d0c4993baffa" title="Set internal mpdfs from given values.">set_elements</a> ( atmp );
-<a name="l00365"></a>00365         }
-<a name="l00366"></a>00366 };
-<a name="l00367"></a>00367 <a class="code" href="user__info_8h.html#a4f9de2f17e844047726487b99def99c6" title="Macro for registration of class into map of user-infos, registered class is scriptable...">UIREGISTER</a> ( mprod );
-<a name="l00368"></a>00368 SHAREDPTR ( mprod );
-<a name="l00369"></a>00369 
-<a name="l00371"></a><a class="code" href="classbdm_1_1eprod.html">00371</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1eprod.html" title="Product of independent epdfs. For dependent pdfs, use mprod.">eprod</a>: <span class="keyword">public</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> {
-<a name="l00372"></a>00372 <span class="keyword">protected</span>:
-<a name="l00374"></a><a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391">00374</a>         Array&lt;const epdf*&gt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>;
-<a name="l00376"></a><a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43">00376</a>         Array&lt;datalink*&gt; <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a>;
-<a name="l00377"></a>00377 <span class="keyword">public</span>:
-<a name="l00379"></a><a class="code" href="classbdm_1_1eprod.html#a9bd36af548d5c350ebe62599aacf91ba">00379</a>         <a class="code" href="classbdm_1_1eprod.html#a9bd36af548d5c350ebe62599aacf91ba" title="Default constructor.">eprod</a> () : <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( 0 ), <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( 0 ) {};
-<a name="l00381"></a><a class="code" href="classbdm_1_1eprod.html#a7f0f526ddcd028c5edaecf250ef780f6">00381</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eprod.html#a7f0f526ddcd028c5edaecf250ef780f6" title="Set internal.">set_parameters</a> ( <span class="keyword">const</span> Array&lt;const epdf*&gt; &amp;epdfs0, <span class="keywordtype">bool</span> named = <span class="keyword">true</span> ) {
-<a name="l00382"></a>00382                 <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> = epdfs0;<span class="comment">//.set_length ( epdfs0.length() );</span>
-<a name="l00383"></a>00383                 <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a>.set_length ( <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length() );
-<a name="l00384"></a>00384 
-<a name="l00385"></a>00385                 <span class="keywordtype">bool</span> independent = <span class="keyword">true</span>;
-<a name="l00386"></a>00386                 <span class="keywordflow">if</span> ( named ) {
-<a name="l00387"></a>00387                         <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
-<a name="l00388"></a>00388                                 independent = <a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#a87841b5ee43997b79789c0c22047e224" title="Add (concat) another variable to the current one,.">add</a> ( <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;<a class="code" href="classbdm_1_1epdf.html#aa4ab378d5e004c3ff3e2d4e64f7bba21" title="Return name (fails when isnamed is false).">_rv</a>() );
-<a name="l00389"></a>00389                                 <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> ( independent, <span class="stringliteral">&quot;eprod:: given components are not independent.&quot;</span> );
-<a name="l00390"></a>00390                         }
-<a name="l00391"></a>00391                         <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>();
-<a name="l00392"></a>00392                 } <span class="keywordflow">else</span> {
-<a name="l00393"></a>00393                         <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = 0;
-<a name="l00394"></a>00394                         <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
-<a name="l00395"></a>00395                                 <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> += <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;dimension();
-<a name="l00396"></a>00396                         }
-<a name="l00397"></a>00397                 }
-<a name="l00398"></a>00398                 <span class="comment">//</span>
-<a name="l00399"></a>00399                 <span class="keywordtype">int</span> cumdim = 0;
-<a name="l00400"></a>00400                 <span class="keywordtype">int</span> dimi = 0;
-<a name="l00401"></a>00401                 <span class="keywordtype">int</span> i;
-<a name="l00402"></a>00402                 <span class="keywordflow">for</span> ( i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
-<a name="l00403"></a>00403                         <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i ) = <span class="keyword">new</span> <a class="code" href="classbdm_1_1datalink.html" title="DataLink is a connection between two data vectors Up and Down.">datalink</a>;
-<a name="l00404"></a>00404                         <span class="keywordflow">if</span> ( named ) {
-<a name="l00405"></a>00405                                 <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )-&gt;set_connection ( <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;<a class="code" href="classbdm_1_1epdf.html#aa4ab378d5e004c3ff3e2d4e64f7bba21" title="Return name (fails when isnamed is false).">_rv</a>() , <a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> );
-<a name="l00406"></a>00406                         } <span class="keywordflow">else</span> {
-<a name="l00407"></a>00407                                 dimi = <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;dimension();
-<a name="l00408"></a>00408                                 <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )-&gt;set_connection ( dimi, <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, linspace ( cumdim, cumdim + dimi - 1 ) );
-<a name="l00409"></a>00409                                 cumdim += dimi;
-<a name="l00410"></a>00410                         }
-<a name="l00411"></a>00411                 }
-<a name="l00412"></a>00412         }
-<a name="l00413"></a>00413 
-<a name="l00414"></a><a class="code" href="classbdm_1_1eprod.html#a1d494351e7e385ad3382387c96915d24">00414</a>         vec <a class="code" href="classbdm_1_1eprod.html#a1d494351e7e385ad3382387c96915d24" title="return expected value">mean</a>()<span class="keyword"> const </span>{
-<a name="l00415"></a>00415                 vec tmp ( <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );
-<a name="l00416"></a>00416                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
-<a name="l00417"></a>00417                         vec pom = <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;mean();
-<a name="l00418"></a>00418                         <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )-&gt;pushup ( tmp, pom );
-<a name="l00419"></a>00419                 }
-<a name="l00420"></a>00420                 <span class="keywordflow">return</span> tmp;
-<a name="l00421"></a>00421         }
-<a name="l00422"></a><a class="code" href="classbdm_1_1eprod.html#acc53a151f5ac5dfba68d425acc3a5615">00422</a>         vec <a class="code" href="classbdm_1_1eprod.html#acc53a151f5ac5dfba68d425acc3a5615" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{
-<a name="l00423"></a>00423                 vec tmp ( <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); <span class="comment">//second moment</span>
-<a name="l00424"></a>00424                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
-<a name="l00425"></a>00425                         vec pom = <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;mean();
-<a name="l00426"></a>00426                         <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )-&gt;pushup ( tmp, pow ( pom, 2 ) );
-<a name="l00427"></a>00427                 }
-<a name="l00428"></a>00428                 <span class="keywordflow">return</span> tmp - pow ( <a class="code" href="classbdm_1_1eprod.html#a1d494351e7e385ad3382387c96915d24" title="return expected value">mean</a>(), 2 );
-<a name="l00429"></a>00429         }
-<a name="l00430"></a><a class="code" href="classbdm_1_1eprod.html#aaf48debea25d3473bcb71b6a77fac741">00430</a>         vec <a class="code" href="classbdm_1_1eprod.html#aaf48debea25d3473bcb71b6a77fac741" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const </span>{
-<a name="l00431"></a>00431                 vec tmp ( <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );
-<a name="l00432"></a>00432                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
-<a name="l00433"></a>00433                         vec pom = <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;sample();
-<a name="l00434"></a>00434                         <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )-&gt;pushup ( tmp, pom );
-<a name="l00435"></a>00435                 }
-<a name="l00436"></a>00436                 <span class="keywordflow">return</span> tmp;
-<a name="l00437"></a>00437         }
-<a name="l00438"></a><a class="code" href="classbdm_1_1eprod.html#aa5a91e67d2f74ff2b0b8eecde2fa42e2">00438</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eprod.html#aa5a91e67d2f74ff2b0b8eecde2fa42e2" title="Compute log-probability of argument val In case the argument is out of suport return...">evallog</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const </span>{
-<a name="l00439"></a>00439                 <span class="keywordtype">double</span> tmp = 0;
-<a name="l00440"></a>00440                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
-<a name="l00441"></a>00441                         tmp += <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;evallog ( <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )-&gt;pushdown ( val ) );
-<a name="l00442"></a>00442                 }
-<a name="l00443"></a>00443                 <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> ( std::isfinite ( tmp ), <span class="stringliteral">&quot;Infinite&quot;</span> );
-<a name="l00444"></a>00444                 <span class="keywordflow">return</span> tmp;
-<a name="l00445"></a>00445         }
-<a name="l00447"></a><a class="code" href="classbdm_1_1eprod.html#a5194b47dd05a5886e0745250b6704953">00447</a>         <span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>* <a class="code" href="classbdm_1_1eprod.html#a5194b47dd05a5886e0745250b6704953" title="access function">operator () </a>( <span class="keywordtype">int</span> i )<span class="keyword"> const </span>{
-<a name="l00448"></a>00448                 <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> ( i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(), <span class="stringliteral">&quot;wrong index&quot;</span> );
-<a name="l00449"></a>00449                 <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i );
-<a name="l00450"></a>00450         }
-<a name="l00451"></a>00451 
-<a name="l00453"></a><a class="code" href="classbdm_1_1eprod.html#a708b37971aab3667f20e325c358632cf">00453</a>         <a class="code" href="classbdm_1_1eprod.html#a708b37971aab3667f20e325c358632cf" title="Destructor.">~eprod</a>() {
-<a name="l00454"></a>00454                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
-<a name="l00455"></a>00455                         <span class="keyword">delete</span> <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i );
-<a name="l00456"></a>00456                 }
-<a name="l00457"></a>00457         }
-<a name="l00458"></a>00458 };
-<a name="l00459"></a>00459 
+<a name="l00339"></a>00339 
+<a name="l00340"></a>00340         <span class="comment">//TODO smarter...</span>
+<a name="l00341"></a><a class="code" href="classbdm_1_1mprod.html#aee715a8013acf9892f6cb489db595555">00341</a>         vec <a class="code" href="classbdm_1_1mprod.html#aee715a8013acf9892f6cb489db595555" title="Returns a sample from the density conditioned on cond, .">samplecond</a> ( <span class="keyword">const</span> vec &amp;cond ) {
+<a name="l00343"></a>00343                 vec smp = std::numeric_limits&lt;double&gt;::infinity() * ones ( dimension() );
+<a name="l00344"></a>00344                 vec smpi;
+<a name="l00345"></a>00345                 <span class="comment">// Hard assumption here!!! We are going backwards, to assure that samples that are needed from smp are already generated!</span>
+<a name="l00346"></a>00346                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = ( mpdfs.length() - 1 ); i &gt;= 0; i-- ) {
+<a name="l00347"></a>00347                         <span class="comment">// generate contribution of this mpdf</span>
+<a name="l00348"></a>00348                         smpi = mpdfs(i)-&gt;samplecond(dls ( i )-&gt;get_cond ( smp , cond ));                        
+<a name="l00349"></a>00349                         <span class="comment">// copy contribution of this pdf into smp</span>
+<a name="l00350"></a>00350                         dls ( i )-&gt;pushup ( smp, smpi );
+<a name="l00351"></a>00351                 }
+<a name="l00352"></a>00352                 <span class="keywordflow">return</span> smp;
+<a name="l00353"></a>00353         }
+<a name="l00354"></a>00354 
+<a name="l00362"></a><a class="code" href="classbdm_1_1mprod.html#abfa7478f8df1de6d8cd4c349db512831">00362</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mprod.html#abfa7478f8df1de6d8cd4c349db512831">from_setting</a> ( <span class="keyword">const</span> Setting &amp;<span class="keyword">set</span> ) {
+<a name="l00363"></a>00363                 Array&lt;shared_ptr&lt;mpdf&gt; &gt; atmp; <span class="comment">//temporary Array</span>
+<a name="l00364"></a>00364                 <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a> ( atmp, <span class="keyword">set</span>, <span class="stringliteral">&quot;mpdfs&quot;</span>, UI::compulsory );
+<a name="l00365"></a>00365                 <a class="code" href="classbdm_1_1mprod.html#aacb4cd6d390ef73a4432d0c4993baffa" title="Set internal mpdfs from given values.">set_elements</a> ( atmp );
+<a name="l00366"></a>00366         }
+<a name="l00367"></a>00367 };
+<a name="l00368"></a>00368 <a class="code" href="user__info_8h.html#a4f9de2f17e844047726487b99def99c6" title="Macro for registration of class into map of user-infos, registered class is scriptable...">UIREGISTER</a> ( mprod );
+<a name="l00369"></a>00369 SHAREDPTR ( mprod );
+<a name="l00370"></a>00370 
+<a name="l00372"></a><a class="code" href="classbdm_1_1eprod.html">00372</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1eprod.html" title="Product of independent epdfs. For dependent pdfs, use mprod.">eprod</a>: <span class="keyword">public</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> {
+<a name="l00373"></a>00373 <span class="keyword">protected</span>:
+<a name="l00375"></a><a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391">00375</a>         Array&lt;const epdf*&gt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>;
+<a name="l00377"></a><a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43">00377</a>         Array&lt;datalink*&gt; <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a>;
+<a name="l00378"></a>00378 <span class="keyword">public</span>:
+<a name="l00380"></a><a class="code" href="classbdm_1_1eprod.html#a9bd36af548d5c350ebe62599aacf91ba">00380</a>         <a class="code" href="classbdm_1_1eprod.html#a9bd36af548d5c350ebe62599aacf91ba" title="Default constructor.">eprod</a> () : <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( 0 ), <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( 0 ) {};
+<a name="l00382"></a><a class="code" href="classbdm_1_1eprod.html#a7f0f526ddcd028c5edaecf250ef780f6">00382</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1eprod.html#a7f0f526ddcd028c5edaecf250ef780f6" title="Set internal.">set_parameters</a> ( <span class="keyword">const</span> Array&lt;const epdf*&gt; &amp;epdfs0, <span class="keywordtype">bool</span> named = <span class="keyword">true</span> ) {
+<a name="l00383"></a>00383                 <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> = epdfs0;<span class="comment">//.set_length ( epdfs0.length() );</span>
+<a name="l00384"></a>00384                 <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a>.set_length ( <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length() );
+<a name="l00385"></a>00385 
+<a name="l00386"></a>00386                 <span class="keywordtype">bool</span> independent = <span class="keyword">true</span>;
+<a name="l00387"></a>00387                 <span class="keywordflow">if</span> ( named ) {
+<a name="l00388"></a>00388                         <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
+<a name="l00389"></a>00389                                 independent = <a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#a87841b5ee43997b79789c0c22047e224" title="Add (concat) another variable to the current one,.">add</a> ( <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;<a class="code" href="classbdm_1_1epdf.html#aa4ab378d5e004c3ff3e2d4e64f7bba21" title="Return name (fails when isnamed is false).">_rv</a>() );
+<a name="l00390"></a>00390                                 <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> ( independent, <span class="stringliteral">&quot;eprod:: given components are not independent.&quot;</span> );
+<a name="l00391"></a>00391                         }
+<a name="l00392"></a>00392                         <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = <a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>();
+<a name="l00393"></a>00393                 } <span class="keywordflow">else</span> {
+<a name="l00394"></a>00394                         <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> = 0;
+<a name="l00395"></a>00395                         <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
+<a name="l00396"></a>00396                                 <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> += <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;dimension();
+<a name="l00397"></a>00397                         }
+<a name="l00398"></a>00398                 }
+<a name="l00399"></a>00399                 <span class="comment">//</span>
+<a name="l00400"></a>00400                 <span class="keywordtype">int</span> cumdim = 0;
+<a name="l00401"></a>00401                 <span class="keywordtype">int</span> dimi = 0;
+<a name="l00402"></a>00402                 <span class="keywordtype">int</span> i;
+<a name="l00403"></a>00403                 <span class="keywordflow">for</span> ( i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
+<a name="l00404"></a>00404                         <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i ) = <span class="keyword">new</span> <a class="code" href="classbdm_1_1datalink.html" title="DataLink is a connection between two data vectors Up and Down.">datalink</a>;
+<a name="l00405"></a>00405                         <span class="keywordflow">if</span> ( named ) {
+<a name="l00406"></a>00406                                 <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )-&gt;set_connection ( <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;<a class="code" href="classbdm_1_1epdf.html#aa4ab378d5e004c3ff3e2d4e64f7bba21" title="Return name (fails when isnamed is false).">_rv</a>() , <a class="code" href="classbdm_1_1epdf.html#a62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> );
+<a name="l00407"></a>00407                         } <span class="keywordflow">else</span> {
+<a name="l00408"></a>00408                                 dimi = <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;dimension();
+<a name="l00409"></a>00409                                 <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )-&gt;set_connection ( dimi, <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, linspace ( cumdim, cumdim + dimi - 1 ) );
+<a name="l00410"></a>00410                                 cumdim += dimi;
+<a name="l00411"></a>00411                         }
+<a name="l00412"></a>00412                 }
+<a name="l00413"></a>00413         }
+<a name="l00414"></a>00414 
+<a name="l00415"></a><a class="code" href="classbdm_1_1eprod.html#a1d494351e7e385ad3382387c96915d24">00415</a>         vec <a class="code" href="classbdm_1_1eprod.html#a1d494351e7e385ad3382387c96915d24" title="return expected value">mean</a>()<span class="keyword"> const </span>{
+<a name="l00416"></a>00416                 vec tmp ( <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );
+<a name="l00417"></a>00417                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
+<a name="l00418"></a>00418                         vec pom = <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;mean();
+<a name="l00419"></a>00419                         <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )-&gt;pushup ( tmp, pom );
+<a name="l00420"></a>00420                 }
+<a name="l00421"></a>00421                 <span class="keywordflow">return</span> tmp;
+<a name="l00422"></a>00422         }
+<a name="l00423"></a><a class="code" href="classbdm_1_1eprod.html#acc53a151f5ac5dfba68d425acc3a5615">00423</a>         vec <a class="code" href="classbdm_1_1eprod.html#acc53a151f5ac5dfba68d425acc3a5615" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{
+<a name="l00424"></a>00424                 vec tmp ( <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); <span class="comment">//second moment</span>
+<a name="l00425"></a>00425                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
+<a name="l00426"></a>00426                         vec pom = <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;mean();
+<a name="l00427"></a>00427                         <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )-&gt;pushup ( tmp, pow ( pom, 2 ) );
+<a name="l00428"></a>00428                 }
+<a name="l00429"></a>00429                 <span class="keywordflow">return</span> tmp - pow ( <a class="code" href="classbdm_1_1eprod.html#a1d494351e7e385ad3382387c96915d24" title="return expected value">mean</a>(), 2 );
+<a name="l00430"></a>00430         }
+<a name="l00431"></a><a class="code" href="classbdm_1_1eprod.html#aaf48debea25d3473bcb71b6a77fac741">00431</a>         vec <a class="code" href="classbdm_1_1eprod.html#aaf48debea25d3473bcb71b6a77fac741" title="Returns a sample,  from density .">sample</a>()<span class="keyword"> const </span>{
+<a name="l00432"></a>00432                 vec tmp ( <a class="code" href="classbdm_1_1epdf.html#a16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );
+<a name="l00433"></a>00433                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
+<a name="l00434"></a>00434                         vec pom = <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;sample();
+<a name="l00435"></a>00435                         <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )-&gt;pushup ( tmp, pom );
+<a name="l00436"></a>00436                 }
+<a name="l00437"></a>00437                 <span class="keywordflow">return</span> tmp;
+<a name="l00438"></a>00438         }
+<a name="l00439"></a><a class="code" href="classbdm_1_1eprod.html#aa5a91e67d2f74ff2b0b8eecde2fa42e2">00439</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eprod.html#aa5a91e67d2f74ff2b0b8eecde2fa42e2">evallog</a> ( <span class="keyword">const</span> vec &amp;val )<span class="keyword"> const </span>{
+<a name="l00440"></a>00440                 <span class="keywordtype">double</span> tmp = 0;
+<a name="l00441"></a>00441                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
+<a name="l00442"></a>00442                         tmp += <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-&gt;evallog ( <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )-&gt;pushdown ( val ) );
+<a name="l00443"></a>00443                 }
+<a name="l00444"></a>00444                 <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> ( std::isfinite ( tmp ), <span class="stringliteral">&quot;Infinite&quot;</span> );
+<a name="l00445"></a>00445                 <span class="keywordflow">return</span> tmp;
+<a name="l00446"></a>00446         }
+<a name="l00448"></a><a class="code" href="classbdm_1_1eprod.html#a5194b47dd05a5886e0745250b6704953">00448</a>         <span class="keyword">const</span> <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>* <a class="code" href="classbdm_1_1eprod.html#a5194b47dd05a5886e0745250b6704953" title="access function">operator () </a>( <span class="keywordtype">int</span> i )<span class="keyword"> const </span>{
+<a name="l00449"></a>00449                 <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> ( i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(), <span class="stringliteral">&quot;wrong index&quot;</span> );
+<a name="l00450"></a>00450                 <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i );
+<a name="l00451"></a>00451         }
+<a name="l00452"></a>00452 
+<a name="l00454"></a><a class="code" href="classbdm_1_1eprod.html#a708b37971aab3667f20e325c358632cf">00454</a>         <a class="code" href="classbdm_1_1eprod.html#a708b37971aab3667f20e325c358632cf" title="Destructor.">~eprod</a>() {
+<a name="l00455"></a>00455                 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classbdm_1_1eprod.html#afa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(); i++ ) {
+<a name="l00456"></a>00456                         <span class="keyword">delete</span> <a class="code" href="classbdm_1_1eprod.html#a6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i );
+<a name="l00457"></a>00457                 }
+<a name="l00458"></a>00458         }
+<a name="l00459"></a>00459 };
 <a name="l00460"></a>00460 
-<a name="l00464"></a><a class="code" href="classbdm_1_1mmix.html">00464</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mmix.html" title="Mixture of mpdfs with constant weights, all mpdfs are of equal RV and RVC.">mmix</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling , where  is random variable, rv, and...">mpdf</a> {
-<a name="l00465"></a>00465 <span class="keyword">protected</span>:
-<a name="l00467"></a><a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809">00467</a>         Array&lt;shared_ptr&lt;mpdf&gt; &gt; <a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>;
-<a name="l00469"></a><a class="code" href="classbdm_1_1mmix.html#af23a22414419b3a4a0a7d97157a03b17">00469</a>         vec <a class="code" href="classbdm_1_1mmix.html#af23a22414419b3a4a0a7d97157a03b17" title="weights of the components">w</a>;
-<a name="l00471"></a><a class="code" href="classbdm_1_1mmix.html#a8c740fff8807cb7f1df6a7e510e10805">00471</a>         <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> <a class="code" href="classbdm_1_1mmix.html#a8c740fff8807cb7f1df6a7e510e10805" title="dummy epdfs">dummy_epdf</a>;
-<a name="l00472"></a>00472 <span class="keyword">public</span>:
-<a name="l00474"></a><a class="code" href="classbdm_1_1mmix.html#aa0cf51b7daeb6751103e94e6b96213fb">00474</a>         <a class="code" href="classbdm_1_1mmix.html#aa0cf51b7daeb6751103e94e6b96213fb" title="Default constructor.">mmix</a>() : <a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>(0), <a class="code" href="classbdm_1_1mmix.html#a8c740fff8807cb7f1df6a7e510e10805" title="dummy epdfs">dummy_epdf</a>() { <a class="code" href="classbdm_1_1mpdf.html#a147afacb393324bb3f9a7a89e33f835e" title="set internal pointer ep to point to given iepdf ">set_ep</a>(<a class="code" href="classbdm_1_1mmix.html#a8c740fff8807cb7f1df6a7e510e10805" title="dummy epdfs">dummy_epdf</a>);    }
-<a name="l00475"></a>00475 
-<a name="l00477"></a><a class="code" href="classbdm_1_1mmix.html#a77f4e69ba18e685bdd1cb92e256a2ea2">00477</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mmix.html#a77f4e69ba18e685bdd1cb92e256a2ea2" title="Set weights w and components R.">set_parameters</a> ( <span class="keyword">const</span> vec &amp;w0, <span class="keyword">const</span> Array&lt;<a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;mpdf&gt;</a> &gt; &amp;Coms0 ) {
-<a name="l00479"></a>00479                 <a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a> = Coms0;
-<a name="l00480"></a>00480                 <a class="code" href="classbdm_1_1mmix.html#af23a22414419b3a4a0a7d97157a03b17" title="weights of the components">w</a>=w0;   
-<a name="l00481"></a>00481 
-<a name="l00482"></a>00482                 <span class="keywordflow">if</span> (Coms0.length()&gt;0){
-<a name="l00483"></a>00483                         set_rv(<a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>(0)-&gt;_rv());
-<a name="l00484"></a>00484                         <a class="code" href="classbdm_1_1mmix.html#a8c740fff8807cb7f1df6a7e510e10805" title="dummy epdfs">dummy_epdf</a>.set_parameters(<a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>(0)-&gt;_rv()._dsize());
-<a name="l00485"></a>00485                         set_rvc(<a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>(0)-&gt;_rvc());
-<a name="l00486"></a>00486                         <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = <a class="code" href="classbdm_1_1mpdf.html#a5a5f08950daa08b85b01ddf4e1c36288" title="random variable in condition">rvc</a>.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>();
-<a name="l00487"></a>00487                 }
-<a name="l00488"></a>00488         }
-<a name="l00489"></a><a class="code" href="classbdm_1_1mmix.html#a33372bfd0ddbcb9f78b4d4b563a24624">00489</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mmix.html#a33372bfd0ddbcb9f78b4d4b563a24624" title="Shortcut for conditioning and evaluation of the internal epdf. In some cases, this...">evallogcond</a> (<span class="keyword">const</span> vec &amp;dt, <span class="keyword">const</span> vec &amp;cond) {
-<a name="l00490"></a>00490                 <span class="keywordtype">double</span> ll=0.0;
-<a name="l00491"></a>00491                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>.length();i++){
-<a name="l00492"></a>00492                         ll+=<a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>(i)-&gt;evallogcond(dt,cond);
-<a name="l00493"></a>00493                 }
-<a name="l00494"></a>00494                 <span class="keywordflow">return</span> ll;
-<a name="l00495"></a>00495         }
-<a name="l00496"></a>00496 
-<a name="l00497"></a>00497         vec <a class="code" href="classbdm_1_1mmix.html#ac97f01cd62bf63e67ddd5b1b8a56cf59" title="Returns a sample from the density conditioned on cond, .">samplecond</a> (<span class="keyword">const</span> vec &amp;cond);
-<a name="l00498"></a>00498 
-<a name="l00499"></a>00499 };
-<a name="l00500"></a>00500 
-<a name="l00501"></a>00501 }
-<a name="l00502"></a>00502 <span class="preprocessor">#endif //MX_H</span>
+<a name="l00461"></a>00461 
+<a name="l00465"></a><a class="code" href="classbdm_1_1mmix.html">00465</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1mmix.html" title="Mixture of mpdfs with constant weights, all mpdfs are of equal RV and RVC.">mmix</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling , where  is random variable, rv, and...">mpdf</a> {
+<a name="l00466"></a>00466 <span class="keyword">protected</span>:
+<a name="l00468"></a><a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809">00468</a>         Array&lt;shared_ptr&lt;mpdf&gt; &gt; <a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>;
+<a name="l00470"></a><a class="code" href="classbdm_1_1mmix.html#af23a22414419b3a4a0a7d97157a03b17">00470</a>         vec <a class="code" href="classbdm_1_1mmix.html#af23a22414419b3a4a0a7d97157a03b17" title="weights of the components">w</a>;
+<a name="l00472"></a><a class="code" href="classbdm_1_1mmix.html#a8c740fff8807cb7f1df6a7e510e10805">00472</a>         <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> <a class="code" href="classbdm_1_1mmix.html#a8c740fff8807cb7f1df6a7e510e10805" title="dummy epdfs">dummy_epdf</a>;
+<a name="l00473"></a>00473 <span class="keyword">public</span>:
+<a name="l00475"></a><a class="code" href="classbdm_1_1mmix.html#aa0cf51b7daeb6751103e94e6b96213fb">00475</a>         <a class="code" href="classbdm_1_1mmix.html#aa0cf51b7daeb6751103e94e6b96213fb" title="Default constructor.">mmix</a>() : <a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>(0), <a class="code" href="classbdm_1_1mmix.html#a8c740fff8807cb7f1df6a7e510e10805" title="dummy epdfs">dummy_epdf</a>() { <a class="code" href="classbdm_1_1mpdf.html#a147afacb393324bb3f9a7a89e33f835e" title="set internal pointer ep to point to given iepdf ">set_ep</a>(<a class="code" href="classbdm_1_1mmix.html#a8c740fff8807cb7f1df6a7e510e10805" title="dummy epdfs">dummy_epdf</a>);    }
+<a name="l00476"></a>00476 
+<a name="l00478"></a><a class="code" href="classbdm_1_1mmix.html#a77f4e69ba18e685bdd1cb92e256a2ea2">00478</a>         <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mmix.html#a77f4e69ba18e685bdd1cb92e256a2ea2" title="Set weights w and components R.">set_parameters</a> ( <span class="keyword">const</span> vec &amp;w0, <span class="keyword">const</span> Array&lt;<a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr&lt;mpdf&gt;</a> &gt; &amp;Coms0 ) {
+<a name="l00480"></a>00480                 <a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a> = Coms0;
+<a name="l00481"></a>00481                 <a class="code" href="classbdm_1_1mmix.html#af23a22414419b3a4a0a7d97157a03b17" title="weights of the components">w</a>=w0;   
+<a name="l00482"></a>00482 
+<a name="l00483"></a>00483                 <span class="keywordflow">if</span> (Coms0.length()&gt;0){
+<a name="l00484"></a>00484                         set_rv(<a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>(0)-&gt;_rv());
+<a name="l00485"></a>00485                         <a class="code" href="classbdm_1_1mmix.html#a8c740fff8807cb7f1df6a7e510e10805" title="dummy epdfs">dummy_epdf</a>.set_parameters(<a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>(0)-&gt;_rv()._dsize());
+<a name="l00486"></a>00486                         set_rvc(<a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>(0)-&gt;_rvc());
+<a name="l00487"></a>00487                         <a class="code" href="classbdm_1_1mpdf.html#a7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> = <a class="code" href="classbdm_1_1mpdf.html#a5a5f08950daa08b85b01ddf4e1c36288" title="random variable in condition">rvc</a>.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>();
+<a name="l00488"></a>00488                 }
+<a name="l00489"></a>00489         }
+<a name="l00490"></a><a class="code" href="classbdm_1_1mmix.html#a33372bfd0ddbcb9f78b4d4b563a24624">00490</a>         <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1mmix.html#a33372bfd0ddbcb9f78b4d4b563a24624" title="Shortcut for conditioning and evaluation of the internal epdf. In some cases, this...">evallogcond</a> (<span class="keyword">const</span> vec &amp;dt, <span class="keyword">const</span> vec &amp;cond) {
+<a name="l00491"></a>00491                 <span class="keywordtype">double</span> ll=0.0;
+<a name="l00492"></a>00492                 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>.length();i++){
+<a name="l00493"></a>00493                         ll+=<a class="code" href="classbdm_1_1mmix.html#a63013f8c57dfb51babc3be7fc5d05809" title="Component (mpdfs).">Coms</a>(i)-&gt;evallogcond(dt,cond);
+<a name="l00494"></a>00494                 }
+<a name="l00495"></a>00495                 <span class="keywordflow">return</span> ll;
+<a name="l00496"></a>00496         }
+<a name="l00497"></a>00497 
+<a name="l00498"></a>00498         vec <a class="code" href="classbdm_1_1mmix.html#ac97f01cd62bf63e67ddd5b1b8a56cf59" title="Returns a sample from the density conditioned on cond, .">samplecond</a> (<span class="keyword">const</span> vec &amp;cond);
+<a name="l00499"></a>00499 
+<a name="l00500"></a>00500 };
+<a name="l00501"></a>00501 
+<a name="l00502"></a>00502 }
+<a name="l00503"></a>00503 <span class="preprocessor">#endif //MX_H</span>
 </pre></div></div>
-<hr size="1"/><address style="text-align: right;"><small>Generated on Mon Oct 12 19:37:19 2009 for mixpp by&nbsp;
+<hr size="1"/><address style="text-align: right;"><small>Generated on Thu Oct 15 00:07:48 2009 for mixpp by&nbsp;
 <a href="http://www.doxygen.org/index.html">
 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
