<?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="libBM_8cpp" kind="file">
    <compoundname>libBM.cpp</compoundname>
    <includes local="no">itpp/itbase.h</includes>
    <includes refid="libBM_8h" local="yes">libBM.h</includes>
    <includes refid="itpp__ext_8h" local="yes">../itpp_ext.h</includes>
    <incdepgraph>
      <node id="352">
        <label>libBM.h</label>
        <link refid="libBM_8h"/>
        <childnode refid="351" relation="include">
        </childnode>
      </node>
      <node id="353">
        <label>../itpp_ext.h</label>
        <link refid="itpp__ext_8h-source"/>
        <childnode refid="351" relation="include">
        </childnode>
      </node>
      <node id="350">
        <label>work/git/mixpp/bdm/stat/libBM.cpp</label>
        <link refid="libBM.cpp"/>
        <childnode refid="351" relation="include">
        </childnode>
        <childnode refid="352" relation="include">
        </childnode>
        <childnode refid="353" relation="include">
        </childnode>
      </node>
      <node id="351">
        <label>itpp/itbase.h</label>
      </node>
    </incdepgraph>
      <sectiondef kind="var">
      <memberdef kind="variable" id="libBM_8cpp_1b056a976f7cfaf78d33b30a8545f8fc4" prot="public" static="yes" mutable="no">
        <type>int</type>
        <definition>int RVcounter</definition>
        <argsstring></argsstring>
        <name>RVcounter</name>
        <initializer>0</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/bdm/stat/libBM.cpp" line="9" bodyfile="/home/smidl/work/git/mixpp/bdm/stat/libBM.cpp" bodystart="9" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="libBM_8cpp_1cad6f15535d10437f6690cb4492176a8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>std::ostream &amp;</type>
        <definition>std::ostream&amp; operator&lt;&lt;</definition>
        <argsstring>(std::ostream &amp;os, const RV &amp;rv)</argsstring>
        <name>operator&lt;&lt;</name>
        <param>
          <type>std::ostream &amp;</type>
          <declname>os</declname>
        </param>
        <param>
          <type>const <ref refid="classRV" kindref="compound">RV</ref> &amp;</type>
          <declname>rv</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/bdm/stat/libBM.cpp" line="120" bodyfile="/home/smidl/work/git/mixpp/bdm/stat/libBM.cpp" bodystart="120" bodyend="127"/>
      </memberdef>
      <memberdef kind="function" id="libBM_8cpp_133c114e83980d883c5b211c47d5322a4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="classRV" kindref="compound">RV</ref></type>
        <definition>RV concat</definition>
        <argsstring>(const RV &amp;rv1, const RV &amp;rv2)</argsstring>
        <name>concat</name>
        <param>
          <type>const <ref refid="classRV" kindref="compound">RV</ref> &amp;</type>
          <declname>rv1</declname>
        </param>
        <param>
          <type>const <ref refid="classRV" kindref="compound">RV</ref> &amp;</type>
          <declname>rv2</declname>
        </param>
        <briefdescription>
<para>Concat two random variables. </para>        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/bdm/stat/libBM.cpp" line="177" bodyfile="/home/smidl/work/git/mixpp/bdm/stat/libBM.cpp" bodystart="177" bodyend="181"/>
        <references refid="classRV_1935790526b630dec4ffefa9ec0c2b6fb" compoundref="libBM_8cpp" startline="51" endline="78">RV::add</references>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="preprocessor">#include<sp/>&lt;itpp/itbase.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="libBM_8h" kindref="compound" tooltip="Bayesian Models (bm) that use Bayes rule to learn from observations.">libBM.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;../itpp_ext.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight></codeline>
<codeline lineno="5"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline>
<codeline lineno="6"><highlight class="normal"></highlight></codeline>
<codeline lineno="7"><highlight class="normal"></highlight><highlight class="keyword">using</highlight><highlight class="normal"><sp/>std::cout;</highlight></codeline>
<codeline lineno="8"><highlight class="normal"></highlight></codeline>
<codeline lineno="9"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>RVcounter=0;</highlight></codeline>
<codeline lineno="10"><highlight class="normal"></highlight></codeline>
<codeline lineno="11"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>RV::init<sp/>(<sp/>ivec<sp/>in_ids,<sp/>Array&lt;std::string&gt;<sp/>in_names,<sp/>ivec<sp/>in_sizes,<sp/>ivec<sp/>in_times<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="12"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//Refer</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="13"><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="14"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref><sp/>=<sp/>in_ids.length();</highlight></codeline>
<codeline lineno="15"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//PRUDENT_MODE</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>All<sp/>vetors<sp/>should<sp/>be<sp/>of<sp/>same<sp/>length</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="17"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>(<sp/><ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref><sp/>!=<sp/>in_names.length()<sp/>)<sp/>||<sp/>\</highlight></codeline>
<codeline lineno="18"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(<sp/><ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref><sp/>!=<sp/>in_sizes.length()<sp/>)<sp/>||<sp/>\</highlight></codeline>
<codeline lineno="19"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(<sp/><ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref><sp/>!=<sp/>in_times.length()<sp/>)<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="20"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_error<sp/>(<sp/></highlight><highlight class="stringliteral">&quot;RV::RV<sp/>inconsistent<sp/>length<sp/>of<sp/>input<sp/>vectors.&quot;</highlight><highlight class="normal"><sp/>);</highlight></codeline>
<codeline lineno="21"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="22"><highlight class="normal"></highlight></codeline>
<codeline lineno="23"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref><sp/>=<sp/>in_ids;</highlight></codeline>
<codeline lineno="24"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_1df5d0030b277a1db2f1fd5fb79152acb" kindref="member" tooltip="Array of names.">names</ref><sp/>=<sp/>in_names;</highlight></codeline>
<codeline lineno="25"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>=<sp/>in_sizes;</highlight></codeline>
<codeline lineno="26"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>=<sp/>in_times;</highlight></codeline>
<codeline lineno="27"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_1f2396efe2e6d656ebe9e6f06018cbe25" kindref="member" tooltip="size = sum of sizes">tsize</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="28"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>i<sp/>=<sp/>0;i<sp/>&lt;<sp/><ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref>;i++<sp/>)<sp/>{<ref refid="classRV_1f2396efe2e6d656ebe9e6f06018cbe25" kindref="member" tooltip="size = sum of sizes">tsize</ref><sp/>+=<sp/><ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>(<sp/>i<sp/>);}</highlight></codeline>
<codeline lineno="29"><highlight class="normal">};</highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight></codeline>
<codeline lineno="31" refid="classRV_1bedfd8d197f0a7ac28a4d412dfc5b8af" refkind="member"><highlight class="normal"><ref refid="classRV_16a22f5c06d6403870d4e414b1993bf9e" kindref="member" tooltip="Constructor of empty RV.">RV::RV</ref><sp/>(<sp/>Array&lt;std::string&gt;<sp/>in_names,<sp/>ivec<sp/>in_sizes,<sp/>ivec<sp/>in_times<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref><sp/>=<sp/>in_names.length();</highlight></codeline>
<codeline lineno="33"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>init<sp/>(<sp/>linspace<sp/>(<sp/>RVcounter+1,<sp/>RVcounter+len<sp/>),<sp/>in_names,<sp/>in_sizes,<sp/>in_times<sp/>);</highlight></codeline>
<codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>RVcounter+=len;</highlight></codeline>
<codeline lineno="35"><highlight class="normal">}</highlight></codeline>
<codeline lineno="36"><highlight class="normal"></highlight></codeline>
<codeline lineno="37" refid="classRV_17b88a74204fdf044e02f2807769839b7" refkind="member"><highlight class="normal"><ref refid="classRV_16a22f5c06d6403870d4e414b1993bf9e" kindref="member" tooltip="Constructor of empty RV.">RV::RV</ref><sp/>(<sp/>Array&lt;std::string&gt;<sp/>in_names,<sp/>ivec<sp/>in_sizes<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref><sp/>=<sp/>in_names.length();</highlight></codeline>
<codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>init<sp/>(<sp/>linspace<sp/>(<sp/>RVcounter+1,<sp/>RVcounter+len<sp/>),<sp/>in_names,<sp/>in_sizes,<sp/>zeros_i<sp/>(<sp/>in_names.length()<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>RVcounter+=len;</highlight></codeline>
<codeline lineno="41"><highlight class="normal">}</highlight></codeline>
<codeline lineno="42"><highlight class="normal"></highlight></codeline>
<codeline lineno="43" refid="classRV_1261702f85831392d7d67e2bcf0b69960" refkind="member"><highlight class="normal"><ref refid="classRV_16a22f5c06d6403870d4e414b1993bf9e" kindref="member" tooltip="Constructor of empty RV.">RV::RV</ref><sp/>(<sp/>Array&lt;std::string&gt;<sp/>in_names<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref><sp/>=<sp/>in_names.length();</highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>init<sp/>(<sp/>linspace<sp/>(<sp/>RVcounter+1,<sp/>RVcounter+len<sp/>),<sp/>in_names,<sp/>ones_i<sp/>(<sp/>in_names.length()<sp/>),<sp/>zeros_i<sp/>(<sp/>in_names.length()<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>RVcounter+=len;</highlight></codeline>
<codeline lineno="47"><highlight class="normal">}</highlight></codeline>
<codeline lineno="48"><highlight class="normal"></highlight></codeline>
<codeline lineno="49" refid="classRV_16a22f5c06d6403870d4e414b1993bf9e" refkind="member"><highlight class="normal"><ref refid="classRV_16a22f5c06d6403870d4e414b1993bf9e" kindref="member" tooltip="Constructor of empty RV.">RV::RV</ref>()<sp/>:<sp/><ref refid="classRV_1f2396efe2e6d656ebe9e6f06018cbe25" kindref="member" tooltip="size = sum of sizes">tsize</ref><sp/>(<sp/>0<sp/>),<sp/><ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref><sp/>(<sp/>0<sp/>),<sp/><ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref><sp/>(<sp/>0<sp/>),<sp/><ref refid="classRV_1df5d0030b277a1db2f1fd5fb79152acb" kindref="member" tooltip="Array of names.">names</ref><sp/>(<sp/>0<sp/>),<sp/><ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>(<sp/>0<sp/>),<sp/><ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>(<sp/>0<sp/>)<sp/>{};</highlight></codeline>
<codeline lineno="50"><highlight class="normal"></highlight></codeline>
<codeline lineno="51" refid="classRV_1935790526b630dec4ffefa9ec0c2b6fb" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/><ref refid="classRV_1935790526b630dec4ffefa9ec0c2b6fb" kindref="member" tooltip="Add (concat) another variable to the current one,.">RV::add</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;rv2<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>TODO</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>rv2.<ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref>&gt;0<sp/>)<sp/>{<sp/></highlight><highlight class="comment">//rv2<sp/>is<sp/>nonempty</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>ind<sp/>=<sp/>rv2.<ref refid="classRV_10c493a7a897f4d75682f4264e40779a1" kindref="member" tooltip="Find indexes of self in another rv,.">findself</ref><sp/>(<sp/>*</highlight><highlight class="keyword">this</highlight><highlight class="normal"><sp/>);<sp/></highlight><highlight class="comment">//should<sp/>be<sp/>-1<sp/>all<sp/>the<sp/>time</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>index<sp/>=<sp/>itpp::find<sp/>(<sp/>ind==-1<sp/>);</highlight></codeline>
<codeline lineno="56"><highlight class="normal"></highlight></codeline>
<codeline lineno="57"><highlight class="normal"></highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>index.length()<sp/>&lt;<sp/>rv2.<ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref><sp/>)<sp/>{<sp/></highlight><highlight class="comment">//conflict</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref><sp/>=<sp/>concat<sp/>(<sp/><ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref>,<sp/>rv2.<ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref><sp/>(<sp/>index<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>=<sp/>concat<sp/>(<sp/>sizes,<sp/>rv2.<ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>(<sp/>index<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>=<sp/>concat<sp/>(<sp/>times,<sp/>rv2.<ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>(<sp/>index<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_1df5d0030b277a1db2f1fd5fb79152acb" kindref="member" tooltip="Array of names.">names</ref><sp/>=<sp/>concat<sp/>(<sp/>names,<sp/>rv2.<ref refid="classRV_1df5d0030b277a1db2f1fd5fb79152acb" kindref="member" tooltip="Array of names.">names</ref><sp/>(<sp/>to_Arr<sp/>(<sp/>index<sp/>)<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref><sp/>=<sp/>concat<sp/>(<sp/><ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref>,<sp/>rv2.<ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref><sp/>);</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>=<sp/>concat<sp/>(<sp/><ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref>,<sp/>rv2.<ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>);</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>=<sp/>concat<sp/>(<sp/><ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref>,<sp/>rv2.<ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>);</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_1df5d0030b277a1db2f1fd5fb79152acb" kindref="member" tooltip="Array of names.">names</ref><sp/>=<sp/>concat<sp/>(<sp/><ref refid="classRV_1df5d0030b277a1db2f1fd5fb79152acb" kindref="member" tooltip="Array of names.">names</ref>,<sp/>rv2.<ref refid="classRV_1df5d0030b277a1db2f1fd5fb79152acb" kindref="member" tooltip="Array of names.">names</ref><sp/>);</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_1f2396efe2e6d656ebe9e6f06018cbe25" kindref="member" tooltip="size = sum of sizes">tsize</ref><sp/>=<sp/>sum<sp/>(<sp/><ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>);</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref><sp/>=<sp/><ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref>.length();</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(<sp/>index.length()<sp/>&lt;rv2.<ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref><sp/>);</highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{<sp/></highlight><highlight class="comment">//rv2<sp/>is<sp/>empty</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="77"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>return<sp/>*this;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="78"><highlight class="normal">};</highlight></codeline>
<codeline lineno="79"><highlight class="normal"></highlight></codeline>
<codeline lineno="80"><highlight class="normal"></highlight><highlight class="comment">//<sp/>RV::RV<sp/>(<sp/>ivec<sp/>in_ids<sp/>)<sp/>{</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="81"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="82"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>len<sp/>=<sp/>in_ids.length();</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="83"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>Array&lt;std::string&gt;<sp/>A<sp/>(<sp/>len<sp/>);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="84"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>std::string<sp/>rvstr<sp/>=<sp/>&quot;rv&quot;;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="85"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="86"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>for<sp/>(<sp/>int<sp/>i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>len;i++<sp/>)<sp/>{</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="87"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>A<sp/>(<sp/>i<sp/>)<sp/>=<sp/>rvstr<sp/>+<sp/>to_str<sp/>(<sp/>i<sp/>);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="88"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>}</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="89"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="90"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>init<sp/>(<sp/>in_ids,<sp/>A,<sp/>ones_i<sp/>(<sp/>len<sp/>),<sp/>zeros_i<sp/>(<sp/>len<sp/>)<sp/>);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="91"><highlight class="normal"></highlight><highlight class="comment">//<sp/>}</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="92"><highlight class="normal"></highlight></codeline>
<codeline lineno="93" refid="classRV_10a9ea7bc6fad270cc54a455a9f8f387d" refkind="member"><highlight class="normal"><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classRV_10a9ea7bc6fad270cc54a455a9f8f387d" kindref="member" tooltip="Select only variables at indeces ind.">RV::subselect</ref><sp/>(<sp/>ivec<sp/>ind<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>ret;</highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ret.<ref refid="classRV_1799b75351112669ea6bcbbbd950c093f" kindref="member" tooltip="auxiliary function used in constructor">init</ref><sp/>(<sp/><ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref><sp/>(<sp/>ind<sp/>),<sp/><ref refid="classRV_1df5d0030b277a1db2f1fd5fb79152acb" kindref="member" tooltip="Array of names.">names</ref><sp/>(<sp/>to_Arr<sp/>(<sp/>ind<sp/>)<sp/>),<sp/><ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>(<sp/>ind<sp/>),<sp/><ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>(<sp/>ind<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="97"><highlight class="normal">}</highlight></codeline>
<codeline lineno="98"><highlight class="normal"></highlight></codeline>
<codeline lineno="99" refid="classRV_1e0a158d53ab9430627241f844f4c9a60" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classRV_1e0a158d53ab9430627241f844f4c9a60" kindref="member" tooltip="Shift time shifted by delta.">RV::t</ref><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>delta<sp/>)<sp/>{<sp/><ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>+=<sp/>delta;}</highlight></codeline>
<codeline lineno="100"><highlight class="normal"></highlight></codeline>
<codeline lineno="101" refid="classRV_165e5b820e482caff7f284d11898ef64f" refkind="member"><highlight class="normal"><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classRV_165e5b820e482caff7f284d11898ef64f" kindref="member" tooltip="Select only variables at indeces ind.">RV::operator() </ref>(<sp/>ivec<sp/>ind<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>ret;</highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>ind.length()<sp/>&gt;0<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ret.<ref refid="classRV_1799b75351112669ea6bcbbbd950c093f" kindref="member" tooltip="auxiliary function used in constructor">init</ref><sp/>(<sp/><ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref><sp/>(<sp/>ind<sp/>),<sp/><ref refid="classRV_1df5d0030b277a1db2f1fd5fb79152acb" kindref="member" tooltip="Array of names.">names</ref><sp/>(<sp/>to_Arr<sp/>(<sp/>ind<sp/>)<sp/>),<sp/><ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>(<sp/>ind<sp/>),<sp/><ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>(<sp/>ind<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="107"><highlight class="normal">}</highlight></codeline>
<codeline lineno="108"><highlight class="normal"></highlight></codeline>
<codeline lineno="109" refid="classRV_182cc7fa22ce91cf461a522ad62014c65" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/><ref refid="classRV_182cc7fa22ce91cf461a522ad62014c65" kindref="member" tooltip="Compare if rv2 is identical to this RV.">RV::equal</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;rv2<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(<sp/><ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref><sp/>==<sp/>rv2.<ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref><sp/>)<sp/>&amp;&amp;<sp/>(<sp/><ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>==<sp/>rv2.<ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>)<sp/>&amp;&amp;<sp/>(<sp/><ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>==<sp/>rv2.<ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>);</highlight></codeline>
<codeline lineno="111"><highlight class="normal">}</highlight></codeline>
<codeline lineno="112"><highlight class="normal"></highlight></codeline>
<codeline lineno="113" refid="classepdf_154d7dd53a641b618771cd9bee135181f" refkind="member"><highlight class="normal">mat<sp/><ref refid="classepdf_154d7dd53a641b618771cd9bee135181f" kindref="member" tooltip="Returns N samples from density .">epdf::sampleN</ref><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>N<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mat<sp/>X<sp/>=<sp/>zeros<sp/>(<sp/><ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref>.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>(),<sp/>N<sp/>);</highlight></codeline>
<codeline lineno="115"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0;i<sp/>&lt;<sp/>N;i++<sp/>)<sp/>X.set_col<sp/>(<sp/>i,<sp/>this-&gt;sample()<sp/>);</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>X;</highlight></codeline>
<codeline lineno="117"><highlight class="normal">};</highlight></codeline>
<codeline lineno="118"><highlight class="normal"></highlight></codeline>
<codeline lineno="119"><highlight class="normal"></highlight></codeline>
<codeline lineno="120" refid="classRV_1cad6f15535d10437f6690cb4492176a8" refkind="member"><highlight class="normal">std::ostream<sp/>&amp;operator&lt;&lt;<sp/>(<sp/>std::ostream<sp/>&amp;os,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;<ref refid="classepdf_174da992e3f5d598da8850b646b79b9d9" kindref="member" tooltip="Identified of the random variable.">rv</ref><sp/>)<sp/>{</highlight></codeline>
<codeline lineno="121"><highlight class="normal"></highlight></codeline>
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>rv.<ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref><sp/>;i++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>os<sp/>&lt;&lt;<sp/>rv.<ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref><sp/>(<sp/>i<sp/>)<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;(&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;<sp/>rv.<ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>(<sp/>i<sp/>)<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;)&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;<sp/><sp/></highlight><highlight class="comment">//<sp/>id(size)=</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="124"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;=&quot;</highlight><highlight class="normal"><sp/>&lt;&lt;<sp/>rv.<ref refid="classRV_1df5d0030b277a1db2f1fd5fb79152acb" kindref="member" tooltip="Array of names.">names</ref><sp/>(<sp/>i<sp/>)<sp/><sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;_{&quot;</highlight><highlight class="normal"><sp/><sp/>&lt;&lt;<sp/>rv.<ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>(<sp/>i<sp/>)<sp/>&lt;&lt;<sp/></highlight><highlight class="stringliteral">&quot;};<sp/>&quot;</highlight><highlight class="normal">;<sp/></highlight><highlight class="comment">//name_{time}</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>os;</highlight></codeline>
<codeline lineno="127"><highlight class="normal">}</highlight></codeline>
<codeline lineno="128"><highlight class="normal"></highlight></codeline>
<codeline lineno="129" refid="classRV_152f3ade796814da627ff5a44d00986be" refkind="member"><highlight class="normal"><ref refid="classstr" kindref="compound" tooltip="Structure of RV (used internally).">str</ref><sp/><ref refid="classRV_152f3ade796814da627ff5a44d00986be" kindref="member" tooltip="generate str from rv, by expanding sizes">RV::tostr</ref>()</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>idlist<sp/>(<sp/><ref refid="classRV_1f2396efe2e6d656ebe9e6f06018cbe25" kindref="member" tooltip="size = sum of sizes">tsize</ref><sp/>);</highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>tmlist<sp/>(<sp/><ref refid="classRV_1f2396efe2e6d656ebe9e6f06018cbe25" kindref="member" tooltip="size = sum of sizes">tsize</ref><sp/>);</highlight></codeline>
<codeline lineno="132"><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="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>pos<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>i<sp/>=<sp/>0;i<sp/>&lt;<sp/><ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref>;i++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>idlist.set_subvector<sp/>(<sp/>pos,<sp/>pos<sp/>+<sp/><ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>(<sp/>i<sp/>)<sp/>-<sp/>1,<sp/><ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref><sp/>(<sp/>i<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmlist.set_subvector<sp/>(<sp/>pos,<sp/>pos<sp/>+<sp/><ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>(<sp/>i<sp/>)<sp/>-<sp/>1,<sp/><ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>(<sp/>i<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pos<sp/>+=<sp/><ref refid="classRV_1c878aab13f34b420e1eb5b485563682b" kindref="member" tooltip="Vector of sizes.">sizes</ref><sp/>(<sp/>i<sp/>);</highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classstr" kindref="compound" tooltip="Structure of RV (used internally).">str</ref><sp/>(<sp/>idlist,<sp/>tmlist<sp/>);</highlight></codeline>
<codeline lineno="140"><highlight class="normal">}</highlight></codeline>
<codeline lineno="141"><highlight class="normal"></highlight></codeline>
<codeline lineno="142" refid="classRV_11844ea0d9c10428f5e0ee1d4d569ef0a" refkind="member"><highlight class="normal">ivec<sp/><ref refid="classRV_11844ea0d9c10428f5e0ee1d4d569ef0a" kindref="member" tooltip="generate indeces into">RV::dataind</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rv2<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classstr" kindref="compound" tooltip="Structure of RV (used internally).">str</ref><sp/>str2<sp/>=<sp/>rv2.<ref refid="classRV_152f3ade796814da627ff5a44d00986be" kindref="member" tooltip="generate str from rv, by expanding sizes">tostr</ref>();</highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>res<sp/>(<sp/>0<sp/>);</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>part;</highlight></codeline>
<codeline lineno="146"><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="147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>i<sp/>=<sp/>0;i<sp/>&lt;<sp/><ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref>;i++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>part<sp/>=<sp/>itpp::find<sp/>(<sp/>(<sp/>str2.<ref refid="classstr_18c4e7241505999c272eb15e586ba7923" kindref="member">ids</ref><sp/>==<sp/><ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref><sp/>(<sp/>i<sp/>)<sp/>)<sp/>&amp;<sp/>(<sp/>str2.<ref refid="classstr_1a55be419d33638dd0b2de3ecd64a4f27" kindref="member">times</ref><sp/>==<sp/><ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>(<sp/>i<sp/>)<sp/>)<sp/>);</highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>res<sp/>=<sp/>concat<sp/>(<sp/>res,<sp/>part<sp/>);</highlight></codeline>
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>res;</highlight></codeline>
<codeline lineno="152"><highlight class="normal">}</highlight></codeline>
<codeline lineno="153"><highlight class="normal"></highlight></codeline>
<codeline lineno="154" refid="classRV_1a85c47bd838ebbdcb6798d7843e87db2" refkind="member"><highlight class="normal"><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classRV_1a85c47bd838ebbdcb6798d7843e87db2" kindref="member" tooltip="Subtract another variable from the current one.">RV::subt</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rv2<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cout<sp/>&lt;&lt;<sp/>*</highlight><highlight class="keyword">this</highlight><highlight class="normal"><sp/>&lt;&lt;endl;</highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cout<sp/>&lt;&lt;<sp/>rv2<sp/>&lt;&lt;endl;</highlight></codeline>
<codeline lineno="157"><highlight class="normal"></highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>res<sp/>=<sp/>this-&gt;<ref refid="classRV_10c493a7a897f4d75682f4264e40779a1" kindref="member" tooltip="Find indexes of self in another rv,.">findself</ref><sp/>(<sp/>rv2<sp/>);<sp/></highlight><highlight class="comment">//<sp/>nonzeros</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>valid<sp/>=<sp/>itpp::find<sp/>(<sp/>res<sp/>==<sp/>-1<sp/>);<sp/></highlight><highlight class="comment">//-1<sp/>=&gt;<sp/>value<sp/>not<sp/>found<sp/>=&gt;<sp/>it<sp/>remains</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(<sp/>*</highlight><highlight class="keyword">this</highlight><highlight class="normal"><sp/>)<sp/>(<sp/>valid<sp/>);<sp/></highlight><highlight class="comment">//keep<sp/>those<sp/>that<sp/>were<sp/>not<sp/>found<sp/>in<sp/>rv2</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="161"><highlight class="normal">}</highlight></codeline>
<codeline lineno="162"><highlight class="normal"></highlight></codeline>
<codeline lineno="163" refid="classRV_10c493a7a897f4d75682f4264e40779a1" refkind="member"><highlight class="normal">ivec<sp/><ref refid="classRV_10c493a7a897f4d75682f4264e40779a1" kindref="member" tooltip="Find indexes of self in another rv,.">RV::findself</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;rv2<sp/>)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
<codeline lineno="164"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,<sp/>j;</highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>tmp<sp/>=<sp/>-ones_i<sp/>(<sp/><ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref><sp/>);</highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>i<sp/>=<sp/>0;i<sp/>&lt;<sp/><ref refid="classRV_10d7b36e2bbccf880c8fcf1e8cc43c1a9" kindref="member" tooltip="len = number of individual rvs">len</ref>;i++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<sp/>j<sp/>=<sp/>0;j<sp/>&lt;<sp/>rv2.<ref refid="classRV_1c114a6f3ff06796cc2f4dacba74291eb" kindref="member" tooltip="Return length (number of entries) of the RV.">length</ref>();j++<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>(<sp/><ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref><sp/>(<sp/>i<sp/>)<sp/>==<sp/>rv2.<ref refid="classRV_11bd7165140f4b880a7f344bbb1c433f9" kindref="member" tooltip="Vector of unique IDs.">ids</ref><sp/>(<sp/>j<sp/>)<sp/>)<sp/>&amp;<sp/>(<sp/><ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>(<sp/>i<sp/>)<sp/>==<sp/>rv2.<ref refid="classRV_1646e530c47a2dd38254b778d9f11ac89" kindref="member" tooltip="Vector of shifts from current time.">times</ref><sp/>(<sp/>j<sp/>)<sp/>)<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tmp<sp/>(<sp/>i<sp/>)<sp/>=<sp/>j;</highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>tmp;</highlight></codeline>
<codeline lineno="175"><highlight class="normal">}</highlight></codeline>
<codeline lineno="176"><highlight class="normal"></highlight></codeline>
<codeline lineno="177" refid="libBM_8h_133c114e83980d883c5b211c47d5322a4" refkind="member"><highlight class="normal"><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>concat<sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;rv1,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&amp;rv2<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="178"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>pom<sp/>=<sp/>rv1;</highlight></codeline>
<codeline lineno="179"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pom.<ref refid="classRV_1935790526b630dec4ffefa9ec0c2b6fb" kindref="member" tooltip="Add (concat) another variable to the current one,.">add</ref><sp/>(<sp/>rv2<sp/>);</highlight></codeline>
<codeline lineno="180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>pom;</highlight></codeline>
<codeline lineno="181"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="/home/smidl/work/git/mixpp/bdm/stat/libBM.cpp"/>
  </compounddef>
</doxygen>
