<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.5.6">
  <compounddef id="emix_8cpp" kind="file">
    <compoundname>emix.cpp</compoundname>
    <includes refid="emix_8h" local="yes">emix.h</includes>
    <incdepgraph>
      <node id="335">
        <label>libBM.h</label>
        <link refid="libBM_8h"/>
        <childnode refid="336" relation="include">
        </childnode>
      </node>
      <node id="334">
        <label>emix.h</label>
        <link refid="emix_8h"/>
        <childnode refid="335" relation="include">
        </childnode>
        <childnode refid="337" relation="include">
        </childnode>
      </node>
      <node id="339">
        <label>../itpp_ext.h</label>
        <link refid="itpp__ext_8h-source"/>
        <childnode refid="336" relation="include">
        </childnode>
      </node>
      <node id="337">
        <label>libEF.h</label>
        <link refid="libEF_8h"/>
        <childnode refid="336" relation="include">
        </childnode>
        <childnode refid="338" relation="include">
        </childnode>
        <childnode refid="335" relation="include">
        </childnode>
        <childnode refid="339" relation="include">
        </childnode>
      </node>
      <node id="336">
        <label>itpp/itbase.h</label>
      </node>
      <node id="338">
        <label>../math/libDC.h</label>
        <link refid="libDC_8h"/>
        <childnode refid="336" relation="include">
        </childnode>
      </node>
      <node id="333">
        <label>work/git/mixpp/bdm/stat/emix.cpp</label>
        <link refid="emix.cpp"/>
        <childnode refid="334" relation="include">
        </childnode>
      </node>
    </incdepgraph>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="preprocessor">#include<sp/>&quot;<ref refid="emix_8h" kindref="compound" tooltip="Probability distributions for Mixtures of pdfs.">emix.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight></codeline>
<codeline lineno="5" refid="classemix_16ce82b24d7fe540ddbf44b472a005555" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classemix_16ce82b24d7fe540ddbf44b472a005555" kindref="member" tooltip="Set weights w and components R.">emix::set_parameters</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;w0,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>Array&lt;epdf*&gt;<sp/>&amp;Coms0<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="6"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classemix_1cdc8f4e2a5e43595ac5450d8a7f9d1ab" kindref="member" tooltip="weights of the components">w</ref><sp/>=<sp/>w0;</highlight></codeline>
<codeline lineno="7"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="8"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>i=0;i&lt;<ref refid="classemix_1cdc8f4e2a5e43595ac5450d8a7f9d1ab" kindref="member" tooltip="weights of the components">w</ref>.length();i++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="9"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug<sp/>(<sp/><ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref>.<ref refid="classRV_182cc7fa22ce91cf461a522ad62014c65" kindref="member" tooltip="Compare if rv2 is identical to this RV.">equal</ref><sp/>(<sp/>Coms0<sp/>(<sp/>i<sp/>)-&gt;<ref refid="classepdf_14778ea61ef400813e47750e024e9fc2f" kindref="member" tooltip="access function, possibly dangerous!">_rv</ref>()<sp/>),</highlight><highlight class="stringliteral">&quot;RVs<sp/>do<sp/>not<sp/>match!&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="10"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="11"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classemix_17155d827417b53fb6aa5cff1459e6eb4" kindref="member" tooltip="Component (epdfs).">Coms</ref><sp/>=<sp/>Coms0;</highlight></codeline>
<codeline lineno="12"><highlight class="normal">}</highlight></codeline>
<codeline lineno="13"><highlight class="normal"></highlight></codeline>
<codeline lineno="14" refid="classemix_10650601f24e633e0ab09aa1e46c14483" refkind="member"><highlight class="normal">vec<sp/><ref refid="classemix_10650601f24e633e0ab09aa1e46c14483" kindref="member" tooltip="Returns the required moment of the epdf.">emix::sample</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="15"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Sample<sp/>which<sp/>component</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vec<sp/>cumDist<sp/>=<sp/>cumsum<sp/>(<sp/><ref refid="classemix_1cdc8f4e2a5e43595ac5450d8a7f9d1ab" kindref="member" tooltip="weights of the components">w</ref><sp/>);</highlight></codeline>
<codeline lineno="17"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>u0<sp/>=<sp/>UniRNG.sample();</highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight></codeline>
<codeline lineno="19"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=0;</highlight></codeline>
<codeline lineno="20"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(<sp/>(<sp/>cumDist<sp/>(<sp/>i<sp/>)<sp/>&lt;u0<sp/>)<sp/>&amp;&amp;<sp/>(<sp/>i&lt;<sp/>(<sp/><ref refid="classemix_1cdc8f4e2a5e43595ac5450d8a7f9d1ab" kindref="member" tooltip="weights of the components">w</ref>.length()-1<sp/>)<sp/>)<sp/>)<sp/>{i++;}</highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight></codeline>
<codeline lineno="22"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classemix_17155d827417b53fb6aa5cff1459e6eb4" kindref="member" tooltip="Component (epdfs).">Coms</ref><sp/>(<sp/>i<sp/>)-&gt;sample();</highlight></codeline>
<codeline lineno="23"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="/home/smidl/work/git/mixpp/bdm/stat/emix.cpp"/>
  </compounddef>
</doxygen>
