Changeset 354 for doc/html/emix_8h-source.html
- Timestamp:
- 06/02/09 10:24:26 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
doc/html/emix_8h-source.html
r353 r354 93 93 <a name="l00058"></a>00058 94 94 <a name="l00059"></a>00059 <span class="comment">//prepare data structures</span> 95 <a name="l00060"></a>00060 <span class="keywordflow">if</span> ( copy ) { <a class="code" href="group__errorhandlingfunc.html#g22d38e98332f9edff88cc501463eedce" title="Abort unconditionally.">it_error</a>( <span class="stringliteral">"todo"</span> ); <a class="code" href="classbdm_1_1mratio.html#51bfe6675e724f7fbeaaeacce5a9f9b8" title="flag for destructor">destroynom</a>=<span class="keyword">true</span>; }95 <a name="l00060"></a>00060 <span class="keywordflow">if</span> ( copy ) {it_error ( <span class="stringliteral">"todo"</span> ); <a class="code" href="classbdm_1_1mratio.html#51bfe6675e724f7fbeaaeacce5a9f9b8" title="flag for destructor">destroynom</a>=<span class="keyword">true</span>; } 96 96 <a name="l00061"></a>00061 <span class="keywordflow">else</span> { <a class="code" href="classbdm_1_1mratio.html#f31caba90a2aa10fbf7631832404fe54" title="Nominator in the form of mpdf.">nom</a> = nom0; <a class="code" href="classbdm_1_1mratio.html#51bfe6675e724f7fbeaaeacce5a9f9b8" title="flag for destructor">destroynom</a> = <span class="keyword">false</span>; } 97 <a name="l00062"></a>00062 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>( <a class="code" href="classbdm_1_1mpdf.html#5a5f08950daa08b85b01ddf4e1c36288" title="random variable in condition">rvc</a>.<a class="code" href="classbdm_1_1RV.html#e9ec8c3e756651ff352ab5e3d3acda4b">length</a>() >0,<span class="stringliteral">"Makes no sense to use this object!"</span> );97 <a name="l00062"></a>00062 it_assert_debug ( <a class="code" href="classbdm_1_1mpdf.html#5a5f08950daa08b85b01ddf4e1c36288" title="random variable in condition">rvc</a>.<a class="code" href="classbdm_1_1RV.html#e9ec8c3e756651ff352ab5e3d3acda4b">length</a>() >0,<span class="stringliteral">"Makes no sense to use this object!"</span> ); 98 98 <a name="l00063"></a>00063 99 99 <a name="l00064"></a>00064 <span class="comment">// build denominator</span> … … 105 105 <a name="l00070"></a>00070 vec nom_val ( <a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>-><a class="code" href="classbdm_1_1epdf.html#7083a65f7b7a0d0d13b2c516bd2ec29c" title="Size of the random variable.">dimension</a>() + <a class="code" href="classbdm_1_1mpdf.html#7c1900976ff13dbc09c9729b3bbff9e6" title="dimension of the condition">dimc</a> ); 106 106 <a name="l00071"></a>00071 <a class="code" href="classbdm_1_1mratio.html#cda5bd23ba60146d69e1f804ff7710c7" title="datalink between conditional and nom">dl</a>.<a class="code" href="classbdm_1_1datalink__m2e.html#b29bc3c7bf2a1d87e77ccaa793d097d5">pushup_cond</a> ( nom_val,val,cond ); 107 <a name="l00072"></a>00072 tmp = <a class="code" href="group__logexpfunc.html#g7a3da29d4e6a8c814237453086793335" title="Exp of the elements of a complex matrix m.">exp</a>( <a class="code" href="classbdm_1_1mratio.html#f31caba90a2aa10fbf7631832404fe54" title="Nominator in the form of mpdf.">nom</a>-><a class="code" href="classbdm_1_1epdf.html#deab266d63c236c277538867d5c3f249" title="Compute log-probability of argument val.">evallog</a> ( nom_val ) - <a class="code" href="classbdm_1_1mratio.html#7daa5d02d3a3be9d15fd4156d886ed88" title="Denominator in the form of epdf.">den</a>-><a class="code" href="classbdm_1_1epdf.html#deab266d63c236c277538867d5c3f249" title="Compute log-probability of argument val.">evallog</a> ( cond ) );108 <a name="l00073"></a>00073 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>( std::isfinite ( tmp ),<span class="stringliteral">"Infinite value"</span> );107 <a name="l00072"></a>00072 tmp = exp ( <a class="code" href="classbdm_1_1mratio.html#f31caba90a2aa10fbf7631832404fe54" title="Nominator in the form of mpdf.">nom</a>-><a class="code" href="classbdm_1_1epdf.html#deab266d63c236c277538867d5c3f249" title="Compute log-probability of argument val.">evallog</a> ( nom_val ) - <a class="code" href="classbdm_1_1mratio.html#7daa5d02d3a3be9d15fd4156d886ed88" title="Denominator in the form of epdf.">den</a>-><a class="code" href="classbdm_1_1epdf.html#deab266d63c236c277538867d5c3f249" title="Compute log-probability of argument val.">evallog</a> ( cond ) ); 108 <a name="l00073"></a>00073 it_assert_debug ( std::isfinite ( tmp ),<span class="stringliteral">"Infinite value"</span> ); 109 109 <a name="l00074"></a>00074 <span class="keywordflow">return</span> tmp; 110 110 <a name="l00075"></a>00075 } … … 116 116 <a name="l00093"></a>00093 <span class="keyword">protected</span>: 117 117 <a name="l00095"></a><a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46">00095</a> vec <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a>; 118 <a name="l00097"></a><a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e">00097</a> <a class="code" href="classitpp_1_1Array.html">Array<epdf*></a><a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a>;118 <a name="l00097"></a><a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e">00097</a> Array<epdf*> <a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a>; 119 119 <a name="l00099"></a><a class="code" href="classbdm_1_1emix.html#47189df41a4616c2fed5972f015743f4">00099</a> <span class="keywordtype">bool</span> <a class="code" href="classbdm_1_1emix.html#47189df41a4616c2fed5972f015743f4" title="Flag if owning Coms.">destroyComs</a>; 120 120 <a name="l00100"></a>00100 <span class="keyword">public</span>: 121 121 <a name="l00102"></a><a class="code" href="classbdm_1_1emix.html#4838f3a376ee0bd3c658bfb8f4ea4a3d">00102</a> <a class="code" href="classbdm_1_1emix.html#4838f3a376ee0bd3c658bfb8f4ea4a3d" title="Default constructor.">emix</a> ( ) : <a class="code" href="classbdm_1_1epdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> ( ) {}; 122 <a name="l00105"></a>00105 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1emix.html#3a107a6b808a081389ef17af951c234a">set_parameters</a> ( <span class="keyword">const</span> vec &<a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a>, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html">Array<epdf*></a>&<a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a>, <span class="keywordtype">bool</span> copy=<span class="keyword">false</span> );122 <a name="l00105"></a>00105 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1emix.html#3a107a6b808a081389ef17af951c234a">set_parameters</a> ( <span class="keyword">const</span> vec &<a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a>, <span class="keyword">const</span> Array<epdf*> &<a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a>, <span class="keywordtype">bool</span> copy=<span class="keyword">false</span> ); 123 123 <a name="l00106"></a>00106 124 124 <a name="l00107"></a>00107 vec <a class="code" href="classbdm_1_1emix.html#e8839dbbb0d1276a8dbe957a67cfe0dc" title="Returns a sample, from density .">sample</a>() <span class="keyword">const</span>; 125 125 <a name="l00108"></a><a class="code" href="classbdm_1_1emix.html#a3a5390bc56e81ef3b0debc0f185fa8a">00108</a> vec <a class="code" href="classbdm_1_1emix.html#a3a5390bc56e81ef3b0debc0f185fa8a" title="return expected value">mean</a>()<span class="keyword"> const </span>{ 126 <a name="l00109"></a>00109 <span class="keywordtype">int</span> i; vec mu = <a class="code" href="group__specmat.html#g10723ecada06221cbe64fe2736a59de1" title="A Double (rows,cols)-matrix of zeros.">zeros</a>( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );126 <a name="l00109"></a>00109 <span class="keywordtype">int</span> i; vec mu = zeros ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 127 127 <a name="l00110"></a>00110 <span class="keywordflow">for</span> ( i = 0;i < <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a>.length();i++ ) {mu += <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a> ( i ) * <a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a> ( i )->mean(); } 128 128 <a name="l00111"></a>00111 <span class="keywordflow">return</span> mu; … … 130 130 <a name="l00113"></a><a class="code" href="classbdm_1_1emix.html#e9a627023cdf90c9ffd8eef726595c86">00113</a> vec <a class="code" href="classbdm_1_1emix.html#e9a627023cdf90c9ffd8eef726595c86" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{ 131 131 <a name="l00114"></a>00114 <span class="comment">//non-central moment</span> 132 <a name="l00115"></a>00115 vec mom2 = <a class="code" href="group__specmat.html#g10723ecada06221cbe64fe2736a59de1" title="A Double (rows,cols)-matrix of zeros.">zeros</a>( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> );133 <a name="l00116"></a>00116 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0;i < <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a>.length();i++ ) {mom2 += <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a> ( i ) * (<a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a>(i)->variance() + <a class="code" href="group__logexpfunc.html#g40f48a75172e7f8bc8e58ed54262a04d" title="Calculates x to the power of y (x^y).">pow</a>( <a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a> ( i )-><a class="code" href="classbdm_1_1emix.html#a3a5390bc56e81ef3b0debc0f185fa8a" title="return expected value">mean</a>(),2 )); }132 <a name="l00115"></a>00115 vec mom2 = zeros ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 133 <a name="l00116"></a>00116 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0;i < <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a>.length();i++ ) {mom2 += <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a> ( i ) * (<a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a>(i)->variance() + pow ( <a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a> ( i )-><a class="code" href="classbdm_1_1emix.html#a3a5390bc56e81ef3b0debc0f185fa8a" title="return expected value">mean</a>(),2 )); } 134 134 <a name="l00117"></a>00117 <span class="comment">//central moment</span> 135 <a name="l00118"></a>00118 <span class="keywordflow">return</span> mom2- <a class="code" href="group__logexpfunc.html#g40f48a75172e7f8bc8e58ed54262a04d" title="Calculates x to the power of y (x^y).">pow</a>( <a class="code" href="classbdm_1_1emix.html#a3a5390bc56e81ef3b0debc0f185fa8a" title="return expected value">mean</a>(),2 );135 <a name="l00118"></a>00118 <span class="keywordflow">return</span> mom2-pow ( <a class="code" href="classbdm_1_1emix.html#a3a5390bc56e81ef3b0debc0f185fa8a" title="return expected value">mean</a>(),2 ); 136 136 <a name="l00119"></a>00119 } 137 137 <a name="l00120"></a><a class="code" href="classbdm_1_1emix.html#0f3db99f730bde6b7953931594537e8e">00120</a> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1emix.html#0f3db99f730bde6b7953931594537e8e" title="Compute log-probability of argument val.">evallog</a> ( <span class="keyword">const</span> vec &val )<span class="keyword"> const </span>{ 138 138 <a name="l00121"></a>00121 <span class="keywordtype">int</span> i; 139 <a name="l00122"></a>00122 <span class="keywordtype">double</span> <a class="code" href="group__matrix__functions.html#gfcf8f54c2f4fc257bbc3111700b08355" title="Sum of elements in the matrix m, either along columns or rows.">sum</a>= 0.0;140 <a name="l00123"></a>00123 <span class="keywordflow">for</span> ( i = 0;i < <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a>.length();i++ ) {sum += <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a> ( i ) * <a class="code" href="group__logexpfunc.html#g7a3da29d4e6a8c814237453086793335" title="Exp of the elements of a complex matrix m.">exp</a>( <a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a> ( i )-><a class="code" href="classbdm_1_1emix.html#0f3db99f730bde6b7953931594537e8e" title="Compute log-probability of argument val.">evallog</a> ( val ) );}139 <a name="l00122"></a>00122 <span class="keywordtype">double</span> sum = 0.0; 140 <a name="l00123"></a>00123 <span class="keywordflow">for</span> ( i = 0;i < <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a>.length();i++ ) {sum += <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a> ( i ) * exp ( <a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a> ( i )-><a class="code" href="classbdm_1_1emix.html#0f3db99f730bde6b7953931594537e8e" title="Compute log-probability of argument val.">evallog</a> ( val ) );} 141 141 <a name="l00124"></a>00124 <span class="keywordflow">if</span> ( sum==0.0 ) {sum=std::numeric_limits<double>::epsilon();} 142 <a name="l00125"></a>00125 <span class="keywordtype">double</span> tmp= <a class="code" href="group__logexpfunc.html#g320dc9f6d27a6cfe4e149633fd1ea566" title="The natural logarithm of the elements.">log</a>( sum );143 <a name="l00126"></a>00126 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>( std::isfinite ( tmp ),<span class="stringliteral">"Infinite"</span> );142 <a name="l00125"></a>00125 <span class="keywordtype">double</span> tmp=log ( sum ); 143 <a name="l00126"></a>00126 it_assert_debug ( std::isfinite ( tmp ),<span class="stringliteral">"Infinite"</span> ); 144 144 <a name="l00127"></a>00127 <span class="keywordflow">return</span> tmp; 145 145 <a name="l00128"></a>00128 }; 146 146 <a name="l00129"></a><a class="code" href="classbdm_1_1emix.html#23af1986e2afcbc8c7e1c30f610e703b">00129</a> vec <a class="code" href="classbdm_1_1emix.html#23af1986e2afcbc8c7e1c30f610e703b" title="Compute log-probability of multiple values argument val.">evallog_m</a> ( <span class="keyword">const</span> mat &Val )<span class="keyword"> const </span>{ 147 <a name="l00130"></a>00130 vec x= <a class="code" href="group__specmat.html#g10723ecada06221cbe64fe2736a59de1" title="A Double (rows,cols)-matrix of zeros.">zeros</a>( Val.cols() );147 <a name="l00130"></a>00130 vec x=zeros ( Val.cols() ); 148 148 <a name="l00131"></a>00131 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i < <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a>.length(); i++ ) { 149 <a name="l00132"></a>00132 x+= <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a> ( i ) * <a class="code" href="group__logexpfunc.html#g7a3da29d4e6a8c814237453086793335" title="Exp of the elements of a complex matrix m.">exp</a>( <a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a> ( i )-><a class="code" href="classbdm_1_1emix.html#23af1986e2afcbc8c7e1c30f610e703b" title="Compute log-probability of multiple values argument val.">evallog_m</a> ( Val ) );149 <a name="l00132"></a>00132 x+= <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a> ( i ) *exp ( <a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a> ( i )-><a class="code" href="classbdm_1_1emix.html#23af1986e2afcbc8c7e1c30f610e703b" title="Compute log-probability of multiple values argument val.">evallog_m</a> ( Val ) ); 150 150 <a name="l00133"></a>00133 } 151 <a name="l00134"></a>00134 <span class="keywordflow">return</span> <a class="code" href="group__logexpfunc.html#g320dc9f6d27a6cfe4e149633fd1ea566" title="The natural logarithm of the elements.">log</a>( x );151 <a name="l00134"></a>00134 <span class="keywordflow">return</span> log ( x ); 152 152 <a name="l00135"></a>00135 }; 153 153 <a name="l00137"></a><a class="code" href="classbdm_1_1emix.html#e64c1d5a73f541e469792e23d4677af2">00137</a> mat <a class="code" href="classbdm_1_1emix.html#e64c1d5a73f541e469792e23d4677af2" title="Auxiliary function that returns pdflog for each component.">evallog_M</a> ( <span class="keyword">const</span> mat &Val )<span class="keyword"> const </span>{ 154 154 <a name="l00138"></a>00138 mat X ( <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a>.length(), Val.cols() ); 155 155 <a name="l00139"></a>00139 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i < <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a>.length(); i++ ) { 156 <a name="l00140"></a>00140 X.set_row ( i, <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a> ( i ) * <a class="code" href="group__logexpfunc.html#g7a3da29d4e6a8c814237453086793335" title="Exp of the elements of a complex matrix m.">exp</a>( <a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a> ( i )-><a class="code" href="classbdm_1_1emix.html#23af1986e2afcbc8c7e1c30f610e703b" title="Compute log-probability of multiple values argument val.">evallog_m</a> ( Val ) ) );156 <a name="l00140"></a>00140 X.set_row ( i, <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a> ( i ) *exp ( <a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a> ( i )-><a class="code" href="classbdm_1_1emix.html#23af1986e2afcbc8c7e1c30f610e703b" title="Compute log-probability of multiple values argument val.">evallog_m</a> ( Val ) ) ); 157 157 <a name="l00141"></a>00141 } 158 158 <a name="l00142"></a>00142 <span class="keywordflow">return</span> X; … … 164 164 <a name="l00148"></a>00148 <span class="comment">//Access methods</span> 165 165 <a name="l00150"></a><a class="code" href="classbdm_1_1emix.html#d9b584cb5b2471a4250fb127757f28be">00150</a> <span class="comment"></span> vec& <a class="code" href="classbdm_1_1emix.html#d9b584cb5b2471a4250fb127757f28be" title="returns a pointer to the internal mean value. Use with Care!">_w</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1emix.html#bb7270345c76da627cd77ddf020bcf46" title="weights of the components">w</a>;} 166 <a name="l00151"></a>00151 <span class="keyword">virtual</span> ~<a class="code" href="classbdm_1_1emix.html" title="Mixture of epdfs.">emix</a>() {<span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1emix.html#47189df41a4616c2fed5972f015743f4" title="Flag if owning Coms.">destroyComs</a> ) {<span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a>. <a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>();i++ ) {<span class="keyword">delete</span> <a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a> ( i );}}}166 <a name="l00151"></a>00151 <span class="keyword">virtual</span> ~<a class="code" href="classbdm_1_1emix.html" title="Mixture of epdfs.">emix</a>() {<span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1emix.html#47189df41a4616c2fed5972f015743f4" title="Flag if owning Coms.">destroyComs</a> ) {<span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a>.length();i++ ) {<span class="keyword">delete</span> <a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a> ( i );}}} 167 167 <a name="l00153"></a><a class="code" href="classbdm_1_1emix.html#965fb16669250a3d28bc62cf76276d8e">00153</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1emix.html#965fb16669250a3d28bc62cf76276d8e" title="Auxiliary function for taking ownership of the Coms().">ownComs</a>() {<a class="code" href="classbdm_1_1emix.html#47189df41a4616c2fed5972f015743f4" title="Flag if owning Coms.">destroyComs</a>=<span class="keyword">true</span>;} 168 168 <a name="l00154"></a>00154 … … 170 170 <a name="l00157"></a><a class="code" href="classbdm_1_1emix.html#04a8632cfa9299ae937228eb732fd61e">00157</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1emix.html#04a8632cfa9299ae937228eb732fd61e" 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> &<a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>){ 171 171 <a name="l00158"></a>00158 <a class="code" href="classbdm_1_1emix.html#04a8632cfa9299ae937228eb732fd61e" title="Name its rv.">epdf::set_rv</a>(rv); 172 <a name="l00159"></a>00159 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a>. <a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>();i++){<a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a>(i)->set_rv(rv);}172 <a name="l00159"></a>00159 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a>.length();i++){<a class="code" href="classbdm_1_1emix.html#e2966a6a44b250e22e55bc9fb6af5c3e" title="Component (epdfs).">Coms</a>(i)->set_rv(rv);} 173 173 <a name="l00160"></a>00160 } 174 174 <a name="l00161"></a>00161 }; … … 178 178 <a name="l00169"></a>00169 <span class="keyword">protected</span>: 179 179 <a name="l00171"></a><a class="code" href="classbdm_1_1egiwmix.html#2deb6d7cd689949b92450227de98afa4">00171</a> vec <a class="code" href="classbdm_1_1egiwmix.html#2deb6d7cd689949b92450227de98afa4" title="weights of the components">w</a>; 180 <a name="l00173"></a><a class="code" href="classbdm_1_1egiwmix.html#8d0a3acd6ced68349b8f9950f4658280">00173</a> <a class="code" href="classitpp_1_1Array.html">Array<egiw*></a><a class="code" href="classbdm_1_1egiwmix.html#8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a>;180 <a name="l00173"></a><a class="code" href="classbdm_1_1egiwmix.html#8d0a3acd6ced68349b8f9950f4658280">00173</a> Array<egiw*> <a class="code" href="classbdm_1_1egiwmix.html#8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a>; 181 181 <a name="l00175"></a><a class="code" href="classbdm_1_1egiwmix.html#2a363169e5aa6c7cad1f4d7647fe9eec">00175</a> <span class="keywordtype">bool</span> <a class="code" href="classbdm_1_1egiwmix.html#2a363169e5aa6c7cad1f4d7647fe9eec" title="Flag if owning Coms.">destroyComs</a>; 182 182 <a name="l00176"></a>00176 <span class="keyword">public</span>: 183 183 <a name="l00178"></a><a class="code" href="classbdm_1_1egiwmix.html#41f4cf7baf554e0a70bf495457179dbb">00178</a> <a class="code" href="classbdm_1_1egiwmix.html#41f4cf7baf554e0a70bf495457179dbb" title="Default constructor.">egiwmix</a> ( ) : <a class="code" href="classbdm_1_1egiw.html" title="Gauss-inverse-Wishart density stored in LD form.">egiw</a> ( ) {}; 184 184 <a name="l00179"></a>00179 185 <a name="l00182"></a>00182 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1egiwmix.html#c4627222e22df6e14f8f1496e13c4975">set_parameters</a> ( <span class="keyword">const</span> vec &<a class="code" href="classbdm_1_1egiwmix.html#2deb6d7cd689949b92450227de98afa4" title="weights of the components">w</a>, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html">Array<egiw*></a>&<a class="code" href="classbdm_1_1egiwmix.html#8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a>, <span class="keywordtype">bool</span> copy=<span class="keyword">false</span> );185 <a name="l00182"></a>00182 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1egiwmix.html#c4627222e22df6e14f8f1496e13c4975">set_parameters</a> ( <span class="keyword">const</span> vec &<a class="code" href="classbdm_1_1egiwmix.html#2deb6d7cd689949b92450227de98afa4" title="weights of the components">w</a>, <span class="keyword">const</span> Array<egiw*> &<a class="code" href="classbdm_1_1egiwmix.html#8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a>, <span class="keywordtype">bool</span> copy=<span class="keyword">false</span> ); 186 186 <a name="l00183"></a>00183 187 187 <a name="l00185"></a>00185 vec <a class="code" href="classbdm_1_1egiwmix.html#74e7c77bd89a454a7fd984945c58df1c" title="return expected value">mean</a>() <span class="keyword">const</span>; … … 199 199 <a name="l00199"></a>00199 <span class="comment">//Access methods</span> 200 200 <a name="l00201"></a><a class="code" href="classbdm_1_1egiwmix.html#884d203ca3994b9fba4c8bd440f355ea">00201</a> <span class="comment"></span> vec& <a class="code" href="classbdm_1_1egiwmix.html#884d203ca3994b9fba4c8bd440f355ea" title="returns a pointer to the internal mean value. Use with Care!">_w</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1egiwmix.html#2deb6d7cd689949b92450227de98afa4" title="weights of the components">w</a>;} 201 <a name="l00202"></a>00202 <span class="keyword">virtual</span> ~<a class="code" href="classbdm_1_1egiwmix.html" title="Mixture of egiws.">egiwmix</a>() {<span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1egiwmix.html#2a363169e5aa6c7cad1f4d7647fe9eec" title="Flag if owning Coms.">destroyComs</a> ) {<span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1egiwmix.html#8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a>. <a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>();i++ ) {<span class="keyword">delete</span> <a class="code" href="classbdm_1_1egiwmix.html#8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a> ( i );}}}201 <a name="l00202"></a>00202 <span class="keyword">virtual</span> ~<a class="code" href="classbdm_1_1egiwmix.html" title="Mixture of egiws.">egiwmix</a>() {<span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1egiwmix.html#2a363169e5aa6c7cad1f4d7647fe9eec" title="Flag if owning Coms.">destroyComs</a> ) {<span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1egiwmix.html#8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a>.length();i++ ) {<span class="keyword">delete</span> <a class="code" href="classbdm_1_1egiwmix.html#8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a> ( i );}}} 202 202 <a name="l00204"></a><a class="code" href="classbdm_1_1egiwmix.html#adc550fe74df25524c20867e89b5b096">00204</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1egiwmix.html#adc550fe74df25524c20867e89b5b096" title="Auxiliary function for taking ownership of the Coms().">ownComs</a>() {<a class="code" href="classbdm_1_1egiwmix.html#2a363169e5aa6c7cad1f4d7647fe9eec" title="Flag if owning Coms.">destroyComs</a>=<span class="keyword">true</span>;} 203 203 <a name="l00205"></a>00205 … … 206 206 <a name="l00209"></a><a class="code" href="classbdm_1_1egiwmix.html#dc999c5c1402c450200f22128db688b2">00209</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1egiwmix.html#dc999c5c1402c450200f22128db688b2" 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> &<a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>){ 207 207 <a name="l00210"></a>00210 <a class="code" href="classbdm_1_1egiwmix.html#dc999c5c1402c450200f22128db688b2" title="Name its rv.">egiw::set_rv</a>(rv); 208 <a name="l00211"></a>00211 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1egiwmix.html#8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a>. <a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>();i++){<a class="code" href="classbdm_1_1egiwmix.html#8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a>(i)->set_rv(rv);}208 <a name="l00211"></a>00211 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1egiwmix.html#8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a>.length();i++){<a class="code" href="classbdm_1_1egiwmix.html#8d0a3acd6ced68349b8f9950f4658280" title="Component (epdfs).">Coms</a>(i)->set_rv(rv);} 209 209 <a name="l00212"></a>00212 } 210 210 <a name="l00213"></a>00213 … … 214 214 <a name="l00226"></a><a class="code" href="classbdm_1_1mprod.html">00226</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_1compositepdf.html" title="Abstract composition of pdfs, will be used for specific classes this abstract class...">compositepdf</a>, <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> { 215 215 <a name="l00227"></a>00227 <span class="keyword">protected</span>: 216 <a name="l00229"></a><a class="code" href="classbdm_1_1mprod.html#eca722ed1b219727c6c0f8cbc6bf1e51">00229</a> <a class="code" href="classitpp_1_1Array.html">Array<epdf*></a><a class="code" href="classbdm_1_1mprod.html#eca722ed1b219727c6c0f8cbc6bf1e51" title="pointers to epdfs - shortcut to mpdfs().posterior()">epdfs</a>;217 <a name="l00231"></a><a class="code" href="classbdm_1_1mprod.html#acf679b3b1d48629c5a042d9ac0d973f">00231</a> <a class="code" href="classitpp_1_1Array.html">Array<datalink_m2m*></a><a class="code" href="classbdm_1_1mprod.html#acf679b3b1d48629c5a042d9ac0d973f" title="Data link for each mpdfs.">dls</a>;216 <a name="l00229"></a><a class="code" href="classbdm_1_1mprod.html#eca722ed1b219727c6c0f8cbc6bf1e51">00229</a> Array<epdf*> <a class="code" href="classbdm_1_1mprod.html#eca722ed1b219727c6c0f8cbc6bf1e51" title="pointers to epdfs - shortcut to mpdfs().posterior()">epdfs</a>; 217 <a name="l00231"></a><a class="code" href="classbdm_1_1mprod.html#acf679b3b1d48629c5a042d9ac0d973f">00231</a> Array<datalink_m2m*> <a class="code" href="classbdm_1_1mprod.html#acf679b3b1d48629c5a042d9ac0d973f" title="Data link for each mpdfs.">dls</a>; 218 218 <a name="l00233"></a><a class="code" href="classbdm_1_1mprod.html#e3fe66c257e5eca9de1031ef44907677">00233</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#e3fe66c257e5eca9de1031ef44907677" title="dummy ep">dummy</a>; 219 219 <a name="l00234"></a>00234 <span class="keyword">public</span>: 220 <a name="l00237"></a><a class="code" href="classbdm_1_1mprod.html#680c3e2d95b116c7cfb227c7f2984525">00237</a> <a class="code" href="classbdm_1_1mprod.html#680c3e2d95b116c7cfb227c7f2984525" title="Constructor from list of mFacs,.">mprod</a> ( <a class="code" href="classitpp_1_1Array.html">Array<mpdf*></a>mFacs ) : <a class="code" href="classbdm_1_1compositepdf.html" title="Abstract composition of pdfs, will be used for specific classes this abstract class...">compositepdf</a> ( mFacs ), <a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> (), <a class="code" href="classbdm_1_1mprod.html#eca722ed1b219727c6c0f8cbc6bf1e51" title="pointers to epdfs - shortcut to mpdfs().posterior()">epdfs</a> ( <a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a> ), <a class="code" href="classbdm_1_1mprod.html#acf679b3b1d48629c5a042d9ac0d973f" title="Data link for each mpdfs.">dls</a> ( <a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a> ) {220 <a name="l00237"></a><a class="code" href="classbdm_1_1mprod.html#680c3e2d95b116c7cfb227c7f2984525">00237</a> <a class="code" href="classbdm_1_1mprod.html#680c3e2d95b116c7cfb227c7f2984525" title="Constructor from list of mFacs,.">mprod</a> ( Array<mpdf*> mFacs ) : <a class="code" href="classbdm_1_1compositepdf.html" title="Abstract composition of pdfs, will be used for specific classes this abstract class...">compositepdf</a> ( mFacs ), <a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> (), <a class="code" href="classbdm_1_1mprod.html#eca722ed1b219727c6c0f8cbc6bf1e51" title="pointers to epdfs - shortcut to mpdfs().posterior()">epdfs</a> ( <a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a> ), <a class="code" href="classbdm_1_1mprod.html#acf679b3b1d48629c5a042d9ac0d973f" title="Data link for each mpdfs.">dls</a> ( <a class="code" href="classbdm_1_1compositepdf.html#7ca3cd8ed92a7154f5b9ff13b1e9d52a" title="Number of mpdfs in the composite.">n</a> ) { 221 221 <a name="l00238"></a>00238 <a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>=&<a class="code" href="classbdm_1_1mprod.html#e3fe66c257e5eca9de1031ef44907677" title="dummy ep">dummy</a>; 222 222 <a name="l00239"></a>00239 <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rv=<a class="code" href="classbdm_1_1compositepdf.html#c73d39acc4378eee6a63155c3517d3c9" title="find common rv, flag">getrv</a> ( <span class="keyword">true</span> ); … … 252 252 <a name="l00269"></a>00269 <span class="comment">//TODO smarter...</span> 253 253 <a name="l00270"></a><a class="code" href="classbdm_1_1mprod.html#ee715a8013acf9892f6cb489db595555">00270</a> vec <a class="code" href="classbdm_1_1mprod.html#ee715a8013acf9892f6cb489db595555" title="Returns a sample from the density conditioned on cond, .">samplecond</a> ( <span class="keyword">const</span> vec &cond ) { 254 <a name="l00272"></a>00272 vec smp= std::numeric_limits<double>::infinity() * <a class="code" href="group__specmat.html#gdc0f3edbf58bced9e82d8b260d395cac" title="A float (rows,cols)-matrix of ones.">ones</a>( <a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>-><a class="code" href="classbdm_1_1epdf.html#7083a65f7b7a0d0d13b2c516bd2ec29c" title="Size of the random variable.">dimension</a>() );254 <a name="l00272"></a>00272 vec smp= std::numeric_limits<double>::infinity() * ones ( <a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a>-><a class="code" href="classbdm_1_1epdf.html#7083a65f7b7a0d0d13b2c516bd2ec29c" title="Size of the random variable.">dimension</a>() ); 255 255 <a name="l00273"></a>00273 vec smpi; 256 256 <a name="l00274"></a>00274 <span class="comment">// Hard assumption here!!! We are going backwards, to assure that samples that are needed from smp are already generated!</span> … … 277 277 <a name="l00296"></a><a class="code" href="classbdm_1_1eprod.html">00296</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> { 278 278 <a name="l00297"></a>00297 <span class="keyword">protected</span>: 279 <a name="l00299"></a><a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391">00299</a> <a class="code" href="classitpp_1_1Array.html">Array<const epdf*></a><a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>;280 <a name="l00301"></a><a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43">00301</a> <a class="code" href="classitpp_1_1Array.html">Array<datalink*></a><a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a>;279 <a name="l00299"></a><a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391">00299</a> Array<const epdf*> <a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>; 280 <a name="l00301"></a><a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43">00301</a> Array<datalink*> <a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a>; 281 281 <a name="l00302"></a>00302 <span class="keyword">public</span>: 282 282 <a name="l00303"></a>00303 <a class="code" href="classbdm_1_1eprod.html" title="Product of independent epdfs. For dependent pdfs, use mprod.">eprod</a> () : <a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( 0 ),<a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( 0 ) {}; 283 <a name="l00304"></a>00304 <span class="keywordtype">void</span> set_parameters ( <span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html">Array<const epdf*></a>&epdfs0, <span class="keywordtype">bool</span> named=<span class="keyword">true</span> ) {283 <a name="l00304"></a>00304 <span class="keywordtype">void</span> set_parameters ( <span class="keyword">const</span> Array<const epdf*> &epdfs0, <span class="keywordtype">bool</span> named=<span class="keyword">true</span> ) { 284 284 <a name="l00305"></a>00305 <a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>=epdfs0;<span class="comment">//.set_length ( epdfs0.length() );</span> 285 <a name="l00306"></a>00306 <a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a>. <a class="code" href="classitpp_1_1Array.html#3709407656d26aae2c5d3e844316d4e0" title="Resizing an Array&lt;T&gt;.">set_length</a> ( <a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.<a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>() );285 <a name="l00306"></a>00306 <a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a>.set_length ( <a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length() ); 286 286 <a name="l00307"></a>00307 287 287 <a name="l00308"></a>00308 <span class="keywordtype">bool</span> independent=<span class="keyword">true</span>; 288 288 <a name="l00309"></a>00309 <span class="keywordflow">if</span> ( named ) { 289 <a name="l00310"></a>00310 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>. <a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>();i++ ) {289 <a name="l00310"></a>00310 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length();i++ ) { 290 290 <a name="l00311"></a>00311 independent=<a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>.<a class="code" href="classbdm_1_1RV.html#87841b5ee43997b79789c0c22047e224" title="Add (concat) another variable to the current one,.">add</a> ( <a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-><a class="code" href="classbdm_1_1epdf.html#a4ab378d5e004c3ff3e2d4e64f7bba21" title="Return name (fails when isnamed is false).">_rv</a>() ); 291 <a name="l00312"></a>00312 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>( independent==<span class="keyword">true</span>, <span class="stringliteral">"eprod:: given components are not independent."</span> );291 <a name="l00312"></a>00312 it_assert_debug ( independent==<span class="keyword">true</span>, <span class="stringliteral">"eprod:: given components are not independent."</span> ); 292 292 <a name="l00313"></a>00313 } 293 293 <a name="l00314"></a>00314 <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>=<a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a>._dsize(); 294 294 <a name="l00315"></a>00315 } 295 295 <a name="l00316"></a>00316 <span class="keywordflow">else</span> { 296 <a name="l00317"></a>00317 <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> =0; <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>. <a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>();i++ ) {296 <a name="l00317"></a>00317 <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> =0; <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length();i++ ) { 297 297 <a name="l00318"></a>00318 <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>+=<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )->dimension(); 298 298 <a name="l00319"></a>00319 } … … 302 302 <a name="l00323"></a>00323 <span class="keywordtype">int</span> dimi=0; 303 303 <a name="l00324"></a>00324 <span class="keywordtype">int</span> i; 304 <a name="l00325"></a>00325 <span class="keywordflow">for</span> ( i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>. <a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>();i++ ) {304 <a name="l00325"></a>00325 <span class="keywordflow">for</span> ( i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length();i++ ) { 305 305 <a name="l00326"></a>00326 <a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i ) = <span class="keyword">new</span> datalink; 306 306 <a name="l00327"></a>00327 <span class="keywordflow">if</span> ( named ) {<a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )->set_connection ( <a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )-><a class="code" href="classbdm_1_1epdf.html#a4ab378d5e004c3ff3e2d4e64f7bba21" title="Return name (fails when isnamed is false).">_rv</a>() , <a class="code" href="classbdm_1_1epdf.html#62c5b8ff71d9ebe6cd58d3c342eb1dc8" title="Description of the random variable.">rv</a> );} 307 307 <a name="l00328"></a>00328 <span class="keywordflow">else</span> { 308 308 <a name="l00329"></a>00329 dimi = <a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )->dimension(); 309 <a name="l00330"></a>00330 <a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )->set_connection ( dimi, <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, <a class="code" href="group__specmat.html#ge5632baa525e231b015f3d45f3503cac" title="Linspace (works in the same way as the matlab version).">linspace</a>( cumdim,cumdim+dimi-1 ) );309 <a name="l00330"></a>00330 <a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )->set_connection ( dimi, <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a>, linspace ( cumdim,cumdim+dimi-1 ) ); 310 310 <a name="l00331"></a>00331 cumdim+=dimi; 311 311 <a name="l00332"></a>00332 } … … 315 315 <a name="l00336"></a><a class="code" href="classbdm_1_1eprod.html#1d494351e7e385ad3382387c96915d24">00336</a> vec <a class="code" href="classbdm_1_1eprod.html#1d494351e7e385ad3382387c96915d24" title="return expected value">mean</a>()<span class="keyword"> const </span>{ 316 316 <a name="l00337"></a>00337 vec tmp ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 317 <a name="l00338"></a>00338 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>. <a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>();i++ ) {317 <a name="l00338"></a>00338 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length();i++ ) { 318 318 <a name="l00339"></a>00339 vec pom = <a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )->mean(); 319 319 <a name="l00340"></a>00340 <a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )->pushup ( tmp, pom ); … … 323 323 <a name="l00344"></a><a class="code" href="classbdm_1_1eprod.html#cc53a151f5ac5dfba68d425acc3a5615">00344</a> vec <a class="code" href="classbdm_1_1eprod.html#cc53a151f5ac5dfba68d425acc3a5615" title="return expected variance (not covariance!)">variance</a>()<span class="keyword"> const </span>{ 324 324 <a name="l00345"></a>00345 vec tmp ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); <span class="comment">//second moment</span> 325 <a name="l00346"></a>00346 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>. <a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>();i++ ) {325 <a name="l00346"></a>00346 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length();i++ ) { 326 326 <a name="l00347"></a>00347 vec pom = <a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )->mean(); 327 <a name="l00348"></a>00348 <a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )->pushup ( tmp, <a class="code" href="group__logexpfunc.html#g40f48a75172e7f8bc8e58ed54262a04d" title="Calculates x to the power of y (x^y).">pow</a>( pom,2 ) );327 <a name="l00348"></a>00348 <a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )->pushup ( tmp, pow ( pom,2 ) ); 328 328 <a name="l00349"></a>00349 } 329 <a name="l00350"></a>00350 <span class="keywordflow">return</span> tmp- <a class="code" href="group__logexpfunc.html#g40f48a75172e7f8bc8e58ed54262a04d" title="Calculates x to the power of y (x^y).">pow</a>( <a class="code" href="classbdm_1_1eprod.html#1d494351e7e385ad3382387c96915d24" title="return expected value">mean</a>(),2 );329 <a name="l00350"></a>00350 <span class="keywordflow">return</span> tmp-pow ( <a class="code" href="classbdm_1_1eprod.html#1d494351e7e385ad3382387c96915d24" title="return expected value">mean</a>(),2 ); 330 330 <a name="l00351"></a>00351 } 331 331 <a name="l00352"></a><a class="code" href="classbdm_1_1eprod.html#af48debea25d3473bcb71b6a77fac741">00352</a> vec <a class="code" href="classbdm_1_1eprod.html#af48debea25d3473bcb71b6a77fac741" title="Returns a sample, from density .">sample</a>()<span class="keyword"> const </span>{ 332 332 <a name="l00353"></a>00353 vec tmp ( <a class="code" href="classbdm_1_1epdf.html#16adac20ec7fe07e1ea0b27d917788ce" title="dimension of the random variable">dim</a> ); 333 <a name="l00354"></a>00354 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>. <a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>();i++ ) {333 <a name="l00354"></a>00354 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length();i++ ) { 334 334 <a name="l00355"></a>00355 vec pom = <a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )->sample(); 335 335 <a name="l00356"></a>00356 <a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )->pushup ( tmp, pom ); … … 339 339 <a name="l00360"></a><a class="code" href="classbdm_1_1eprod.html#a5a91e67d2f74ff2b0b8eecde2fa42e2">00360</a> <span class="keywordtype">double</span> <a class="code" href="classbdm_1_1eprod.html#a5a91e67d2f74ff2b0b8eecde2fa42e2" title="Compute log-probability of argument val.">evallog</a> ( <span class="keyword">const</span> vec &val )<span class="keyword"> const </span>{ 340 340 <a name="l00361"></a>00361 <span class="keywordtype">double</span> tmp=0; 341 <a name="l00362"></a>00362 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>. <a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>();i++ ) {341 <a name="l00362"></a>00362 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length();i++ ) { 342 342 <a name="l00363"></a>00363 tmp+=<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i )->evallog ( <a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i )->pushdown ( val ) ); 343 343 <a name="l00364"></a>00364 } 344 <a name="l00365"></a>00365 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>( std::isfinite ( tmp ),<span class="stringliteral">"Infinite"</span> );344 <a name="l00365"></a>00365 it_assert_debug ( std::isfinite ( tmp ),<span class="stringliteral">"Infinite"</span> ); 345 345 <a name="l00366"></a>00366 <span class="keywordflow">return</span> tmp; 346 346 <a name="l00367"></a>00367 } 347 <a name="l00369"></a><a class="code" href="classbdm_1_1eprod.html#5194b47dd05a5886e0745250b6704953">00369</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#5194b47dd05a5886e0745250b6704953" title="access function">operator () </a>( <span class="keywordtype">int</span> i )<span class="keyword"> const </span>{ <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a> ( i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.<a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>(),<span class="stringliteral">"wrong index"</span> );<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i );}347 <a name="l00369"></a><a class="code" href="classbdm_1_1eprod.html#5194b47dd05a5886e0745250b6704953">00369</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#5194b47dd05a5886e0745250b6704953" title="access function">operator () </a>( <span class="keywordtype">int</span> i )<span class="keyword"> const </span>{it_assert_debug ( i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length(),<span class="stringliteral">"wrong index"</span> );<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a> ( i );} 348 348 <a name="l00370"></a>00370 349 <a name="l00372"></a><a class="code" href="classbdm_1_1eprod.html#708b37971aab3667f20e325c358632cf">00372</a> <a class="code" href="classbdm_1_1eprod.html#708b37971aab3667f20e325c358632cf" title="Destructor.">~eprod</a>() {<span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>. <a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>();i++ ) {<span class="keyword">delete</span> <a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i );}}349 <a name="l00372"></a><a class="code" href="classbdm_1_1eprod.html#708b37971aab3667f20e325c358632cf">00372</a> <a class="code" href="classbdm_1_1eprod.html#708b37971aab3667f20e325c358632cf" title="Destructor.">~eprod</a>() {<span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<<a class="code" href="classbdm_1_1eprod.html#fa0b0981730f0a8339b9ff3e29d78391" title="Components (epdfs).">epdfs</a>.length();i++ ) {<span class="keyword">delete</span> <a class="code" href="classbdm_1_1eprod.html#6b5a9be71a644f6009e7beda6c762a43" title="Array of indeces.">dls</a> ( i );}} 350 350 <a name="l00373"></a>00373 }; 351 351 <a name="l00374"></a>00374 … … 353 353 <a name="l00379"></a><a class="code" href="classbdm_1_1mmix.html">00379</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 type.">mmix</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> { 354 354 <a name="l00380"></a>00380 <span class="keyword">protected</span>: 355 <a name="l00382"></a><a class="code" href="classbdm_1_1mmix.html#52e0bcc70d5b26babeba08097579da9c">00382</a> <a class="code" href="classitpp_1_1Array.html">Array<mpdf*></a><a class="code" href="classbdm_1_1mmix.html#52e0bcc70d5b26babeba08097579da9c" title="Component (epdfs).">Coms</a>;355 <a name="l00382"></a><a class="code" href="classbdm_1_1mmix.html#52e0bcc70d5b26babeba08097579da9c">00382</a> Array<mpdf*> <a class="code" href="classbdm_1_1mmix.html#52e0bcc70d5b26babeba08097579da9c" title="Component (epdfs).">Coms</a>; 356 356 <a name="l00384"></a><a class="code" href="classbdm_1_1mmix.html#0c4dd6ca6556ddd8ae3c5f3257c04b60">00384</a> <a class="code" href="classbdm_1_1emix.html" title="Mixture of epdfs.">emix</a> <a class="code" href="classbdm_1_1mmix.html#0c4dd6ca6556ddd8ae3c5f3257c04b60" title="Internal epdf.">Epdf</a>; 357 357 <a name="l00385"></a>00385 <span class="keyword">public</span>: 358 358 <a name="l00387"></a><a class="code" href="classbdm_1_1mmix.html#a0cf51b7daeb6751103e94e6b96213fb">00387</a> <a class="code" href="classbdm_1_1mmix.html#a0cf51b7daeb6751103e94e6b96213fb" title="Default constructor.">mmix</a> ( ) : <a class="code" href="classbdm_1_1mpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> ( ), <a class="code" href="classbdm_1_1mmix.html#0c4dd6ca6556ddd8ae3c5f3257c04b60" title="Internal epdf.">Epdf</a> () {<a class="code" href="classbdm_1_1mpdf.html#5eea43c56d38e4441bfb30270db949c0" title="pointer to internal epdf">ep</a> = &<a class="code" href="classbdm_1_1mmix.html#0c4dd6ca6556ddd8ae3c5f3257c04b60" title="Internal epdf.">Epdf</a>;}; 359 <a name="l00389"></a><a class="code" href="classbdm_1_1mmix.html#ad8d9df36cb0ca093a29af0eca12da32">00389</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mmix.html#ad8d9df36cb0ca093a29af0eca12da32" title="Set weights w and components R.">set_parameters</a> ( <span class="keyword">const</span> vec &w, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html">Array<mpdf*></a>&<a class="code" href="classbdm_1_1mmix.html#52e0bcc70d5b26babeba08097579da9c" title="Component (epdfs).">Coms</a> ) {360 <a name="l00390"></a>00390 <a class="code" href="classitpp_1_1Array.html">Array<epdf*></a> Eps ( Coms.<a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>() );359 <a name="l00389"></a><a class="code" href="classbdm_1_1mmix.html#ad8d9df36cb0ca093a29af0eca12da32">00389</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mmix.html#ad8d9df36cb0ca093a29af0eca12da32" title="Set weights w and components R.">set_parameters</a> ( <span class="keyword">const</span> vec &w, <span class="keyword">const</span> Array<mpdf*> &<a class="code" href="classbdm_1_1mmix.html#52e0bcc70d5b26babeba08097579da9c" title="Component (epdfs).">Coms</a> ) { 360 <a name="l00390"></a>00390 Array<epdf*> Eps ( Coms.length() ); 361 361 <a name="l00391"></a>00391 362 <a name="l00392"></a>00392 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0;i < Coms. <a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>();i++ ) {362 <a name="l00392"></a>00392 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0;i < Coms.length();i++ ) { 363 363 <a name="l00393"></a>00393 Eps ( i ) = & ( <a class="code" href="classbdm_1_1mmix.html#52e0bcc70d5b26babeba08097579da9c" title="Component (epdfs).">Coms</a> ( i )->_epdf() ); 364 364 <a name="l00394"></a>00394 } … … 367 367 <a name="l00397"></a>00397 368 368 <a name="l00398"></a><a class="code" href="classbdm_1_1mmix.html#0a5241ecc9911e816b00b92d5c7c8df0">00398</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1mmix.html#0a5241ecc9911e816b00b92d5c7c8df0" title="Update ep so that it represents this mpdf conditioned on rvc = cond.">condition</a> ( <span class="keyword">const</span> vec &cond ) { 369 <a name="l00399"></a>00399 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0;i < <a class="code" href="classbdm_1_1mmix.html#52e0bcc70d5b26babeba08097579da9c" title="Component (epdfs).">Coms</a>. <a class="code" href="classitpp_1_1Array.html#53629018f146084de506c33c69fa19a3" title="Returns the number of data elements in the array object.">length</a>();i++ ) {<a class="code" href="classbdm_1_1mmix.html#52e0bcc70d5b26babeba08097579da9c" title="Component (epdfs).">Coms</a> ( i )->condition ( cond );}369 <a name="l00399"></a>00399 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0;i < <a class="code" href="classbdm_1_1mmix.html#52e0bcc70d5b26babeba08097579da9c" title="Component (epdfs).">Coms</a>.length();i++ ) {<a class="code" href="classbdm_1_1mmix.html#52e0bcc70d5b26babeba08097579da9c" title="Component (epdfs).">Coms</a> ( i )->condition ( cond );} 370 370 <a name="l00400"></a>00400 }; 371 371 <a name="l00401"></a>00401 }; … … 374 374 <a name="l00404"></a>00404 <span class="preprocessor">#endif //MX_H</span> 375 375 </pre></div></div> 376 <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10: 02:112009 for mixpp by 376 <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:11:00 2009 for mixpp by 377 377 <a href="http://www.doxygen.org/index.html"> 378 378 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>