root/doc/xml/libBM_8cpp.xml @ 221

Revision 187, 54.3 kB (checked in by smidl, 16 years ago)

doc

Line 
1<?xml version='1.0' encoding='UTF-8' standalone='no'?>
2<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.5.6">
3  <compounddef id="libBM_8cpp" kind="file">
4    <compoundname>libBM.cpp</compoundname>
5    <includes local="no">itpp/itbase.h</includes>
6    <includes refid="libBM_8h" local="yes">libBM.h</includes>
7    <includes refid="itpp__ext_8h" local="yes">../itpp_ext.h</includes>
8    <incdepgraph>
9      <node id="352">
10        <label>libBM.h</label>
11        <link refid="libBM_8h"/>
12        <childnode refid="351" relation="include">
13        </childnode>
14      </node>
15      <node id="353">
16        <label>../itpp_ext.h</label>
17        <link refid="itpp__ext_8h-source"/>
18        <childnode refid="351" relation="include">
19        </childnode>
20      </node>
21      <node id="350">
22        <label>work/git/mixpp/bdm/stat/libBM.cpp</label>
23        <link refid="libBM.cpp"/>
24        <childnode refid="351" relation="include">
25        </childnode>
26        <childnode refid="352" relation="include">
27        </childnode>
28        <childnode refid="353" relation="include">
29        </childnode>
30      </node>
31      <node id="351">
32        <label>itpp/itbase.h</label>
33      </node>
34    </incdepgraph>
35      <sectiondef kind="var">
36      <memberdef kind="variable" id="libBM_8cpp_1b056a976f7cfaf78d33b30a8545f8fc4" prot="public" static="yes" mutable="no">
37        <type>int</type>
38        <definition>int RVcounter</definition>
39        <argsstring></argsstring>
40        <name>RVcounter</name>
41        <initializer>0</initializer>
42        <briefdescription>
43        </briefdescription>
44        <detaileddescription>
45        </detaileddescription>
46        <inbodydescription>
47        </inbodydescription>
48        <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"/>
49      </memberdef>
50      </sectiondef>
51      <sectiondef kind="func">
52      <memberdef kind="function" id="libBM_8cpp_1cad6f15535d10437f6690cb4492176a8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
53        <type>std::ostream &amp;</type>
54        <definition>std::ostream&amp; operator&lt;&lt;</definition>
55        <argsstring>(std::ostream &amp;os, const RV &amp;rv)</argsstring>
56        <name>operator&lt;&lt;</name>
57        <param>
58          <type>std::ostream &amp;</type>
59          <declname>os</declname>
60        </param>
61        <param>
62          <type>const <ref refid="classRV" kindref="compound">RV</ref> &amp;</type>
63          <declname>rv</declname>
64        </param>
65        <briefdescription>
66        </briefdescription>
67        <detaileddescription>
68        </detaileddescription>
69        <inbodydescription>
70        </inbodydescription>
71        <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"/>
72      </memberdef>
73      <memberdef kind="function" id="libBM_8cpp_133c114e83980d883c5b211c47d5322a4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
74        <type><ref refid="classRV" kindref="compound">RV</ref></type>
75        <definition>RV concat</definition>
76        <argsstring>(const RV &amp;rv1, const RV &amp;rv2)</argsstring>
77        <name>concat</name>
78        <param>
79          <type>const <ref refid="classRV" kindref="compound">RV</ref> &amp;</type>
80          <declname>rv1</declname>
81        </param>
82        <param>
83          <type>const <ref refid="classRV" kindref="compound">RV</ref> &amp;</type>
84          <declname>rv2</declname>
85        </param>
86        <briefdescription>
87<para>Concat two random variables. </para>        </briefdescription>
88        <detaileddescription>
89        </detaileddescription>
90        <inbodydescription>
91        </inbodydescription>
92        <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"/>
93        <references refid="classRV_1935790526b630dec4ffefa9ec0c2b6fb" compoundref="libBM_8cpp" startline="51" endline="78">RV::add</references>
94      </memberdef>
95      </sectiondef>
96    <briefdescription>
97    </briefdescription>
98    <detaileddescription>
99    </detaileddescription>
100    <programlisting>
101<codeline lineno="1"><highlight class="preprocessor">#include<sp/>&lt;itpp/itbase.h&gt;</highlight><highlight class="normal"></highlight></codeline>
102<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>
103<codeline lineno="3"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;../itpp_ext.h&quot;</highlight><highlight class="normal"></highlight></codeline>
104<codeline lineno="4"><highlight class="normal"></highlight></codeline>
105<codeline lineno="5"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline>
106<codeline lineno="6"><highlight class="normal"></highlight></codeline>
107<codeline lineno="7"><highlight class="normal"></highlight><highlight class="keyword">using</highlight><highlight class="normal"><sp/>std::cout;</highlight></codeline>
108<codeline lineno="8"><highlight class="normal"></highlight></codeline>
109<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>
110<codeline lineno="10"><highlight class="normal"></highlight></codeline>
111<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>
112<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>
113<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>
114<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>
115<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>
116<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>
117<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>
118<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>
119<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>
120<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>
121<codeline lineno="21"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
122<codeline lineno="22"><highlight class="normal"></highlight></codeline>
123<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>
124<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>
125<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>
126<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>
127<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>
128<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>
129<codeline lineno="29"><highlight class="normal">};</highlight></codeline>
130<codeline lineno="30"><highlight class="normal"></highlight></codeline>
131<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>
132<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>
133<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>
134<codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>RVcounter+=len;</highlight></codeline>
135<codeline lineno="35"><highlight class="normal">}</highlight></codeline>
136<codeline lineno="36"><highlight class="normal"></highlight></codeline>
137<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>
138<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>
139<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>
140<codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>RVcounter+=len;</highlight></codeline>
141<codeline lineno="41"><highlight class="normal">}</highlight></codeline>
142<codeline lineno="42"><highlight class="normal"></highlight></codeline>
143<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>
144<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>
145<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>
146<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>RVcounter+=len;</highlight></codeline>
147<codeline lineno="47"><highlight class="normal">}</highlight></codeline>
148<codeline lineno="48"><highlight class="normal"></highlight></codeline>
149<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>
150<codeline lineno="50"><highlight class="normal"></highlight></codeline>
151<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>
152<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>
153<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>
154<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>
155<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>
156<codeline lineno="56"><highlight class="normal"></highlight></codeline>
157<codeline lineno="57"><highlight class="normal"></highlight></codeline>
158<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>
159<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>
160<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>
161<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>
162<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>
163<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
164<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>
165<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>
166<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>
167<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>
168<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>
169<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
170<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>
171<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>
172<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>
173<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
174<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>
175<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>
176<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
177<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>
178<codeline lineno="78"><highlight class="normal">};</highlight></codeline>
179<codeline lineno="79"><highlight class="normal"></highlight></codeline>
180<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>
181<codeline lineno="81"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
182<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>
183<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>
184<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>
185<codeline lineno="85"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
186<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>
187<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>
188<codeline lineno="88"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/><sp/>}</highlight><highlight class="normal"></highlight></codeline>
189<codeline lineno="89"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
190<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>
191<codeline lineno="91"><highlight class="normal"></highlight><highlight class="comment">//<sp/>}</highlight><highlight class="normal"></highlight></codeline>
192<codeline lineno="92"><highlight class="normal"></highlight></codeline>
193<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>
194<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>
195<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>
196<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>
197<codeline lineno="97"><highlight class="normal">}</highlight></codeline>
198<codeline lineno="98"><highlight class="normal"></highlight></codeline>
199<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>
200<codeline lineno="100"><highlight class="normal"></highlight></codeline>
201<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>
202<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>
203<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>
204<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>
205<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
206<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>
207<codeline lineno="107"><highlight class="normal">}</highlight></codeline>
208<codeline lineno="108"><highlight class="normal"></highlight></codeline>
209<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>
210<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>
211<codeline lineno="111"><highlight class="normal">}</highlight></codeline>
212<codeline lineno="112"><highlight class="normal"></highlight></codeline>
213<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>
214<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>
215<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>
216<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>
217<codeline lineno="117"><highlight class="normal">};</highlight></codeline>
218<codeline lineno="118"><highlight class="normal"></highlight></codeline>
219<codeline lineno="119"><highlight class="normal"></highlight></codeline>
220<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>
221<codeline lineno="121"><highlight class="normal"></highlight></codeline>
222<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>
223<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>
224<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>
225<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
226<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>
227<codeline lineno="127"><highlight class="normal">}</highlight></codeline>
228<codeline lineno="128"><highlight class="normal"></highlight></codeline>
229<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>
230<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>
231<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>
232<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>
233<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>
234<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>
235<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>
236<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>
237<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>
238<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
239<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>
240<codeline lineno="140"><highlight class="normal">}</highlight></codeline>
241<codeline lineno="141"><highlight class="normal"></highlight></codeline>
242<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>
243<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>
244<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>res<sp/>(<sp/>0<sp/>);</highlight></codeline>
245<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ivec<sp/>part;</highlight></codeline>
246<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>
247<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>
248<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>
249<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>
250<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
251<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>
252<codeline lineno="152"><highlight class="normal">}</highlight></codeline>
253<codeline lineno="153"><highlight class="normal"></highlight></codeline>
254<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>
255<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>
256<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>
257<codeline lineno="157"><highlight class="normal"></highlight></codeline>
258<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>
259<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>
260<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>
261<codeline lineno="161"><highlight class="normal">}</highlight></codeline>
262<codeline lineno="162"><highlight class="normal"></highlight></codeline>
263<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>
264<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>
265<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>
266<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>
267<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>
268<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>
269<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>
270<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>
271<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>
272<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
273<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
274<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>
275<codeline lineno="175"><highlight class="normal">}</highlight></codeline>
276<codeline lineno="176"><highlight class="normal"></highlight></codeline>
277<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>
278<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>
279<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>
280<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>
281<codeline lineno="181"><highlight class="normal">}</highlight></codeline>
282    </programlisting>
283    <location file="/home/smidl/work/git/mixpp/bdm/stat/libBM.cpp"/>
284  </compounddef>
285</doxygen>
Note: See TracBrowser for help on using the browser.