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="libDS_8cpp" kind="file"> |
---|
4 | <compoundname>libDS.cpp</compoundname> |
---|
5 | <includes local="no">itpp/itbase.h</includes> |
---|
6 | <includes refid="libDS_8h" local="yes">libDS.h</includes> |
---|
7 | <incdepgraph> |
---|
8 | <node id="376"> |
---|
9 | <label>libBM.h</label> |
---|
10 | <link refid="libBM_8h"/> |
---|
11 | <childnode refid="374" relation="include"> |
---|
12 | </childnode> |
---|
13 | </node> |
---|
14 | <node id="373"> |
---|
15 | <label>work/git/mixpp/bdm/stat/libDS.cpp</label> |
---|
16 | <link refid="libDS.cpp"/> |
---|
17 | <childnode refid="374" relation="include"> |
---|
18 | </childnode> |
---|
19 | <childnode refid="375" relation="include"> |
---|
20 | </childnode> |
---|
21 | </node> |
---|
22 | <node id="374"> |
---|
23 | <label>itpp/itbase.h</label> |
---|
24 | </node> |
---|
25 | <node id="375"> |
---|
26 | <label>libDS.h</label> |
---|
27 | <link refid="libDS_8h"/> |
---|
28 | <childnode refid="374" relation="include"> |
---|
29 | </childnode> |
---|
30 | <childnode refid="376" relation="include"> |
---|
31 | </childnode> |
---|
32 | </node> |
---|
33 | </incdepgraph> |
---|
34 | <briefdescription> |
---|
35 | </briefdescription> |
---|
36 | <detaileddescription> |
---|
37 | </detaileddescription> |
---|
38 | <programlisting> |
---|
39 | <codeline lineno="1"><highlight class="preprocessor">#include<sp/><itpp/itbase.h></highlight><highlight class="normal"></highlight></codeline> |
---|
40 | <codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>"<ref refid="libDS_8h" kindref="compound" tooltip="Common DataSources.">libDS.h</ref>"</highlight><highlight class="normal"></highlight></codeline> |
---|
41 | <codeline lineno="3"><highlight class="normal"></highlight></codeline> |
---|
42 | <codeline lineno="4"><highlight class="normal"></highlight><highlight class="comment">//using<sp/>namespace<sp/>itpp;</highlight><highlight class="normal"></highlight></codeline> |
---|
43 | <codeline lineno="5"><highlight class="normal"></highlight></codeline> |
---|
44 | <codeline lineno="6" refid="classMemDS_123522b9e7dd0bb0c365cc9cde4c05449" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classMemDS_123522b9e7dd0bb0c365cc9cde4c05449" kindref="member" tooltip="Returns full vector of observed data.">MemDS::getdata</ref>(vec<sp/>&dt){</highlight></codeline> |
---|
45 | <codeline lineno="7"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline> |
---|
46 | <codeline lineno="8"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
47 | <codeline lineno="9"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug(dt.length()==rowid.length(),<sp/></highlight><highlight class="stringliteral">"MemDS:getdata<sp/>incompatible<sp/>dt"</highlight><highlight class="normal">);</highlight></codeline> |
---|
48 | <codeline lineno="10"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;i<rowid.length();i++){</highlight></codeline> |
---|
49 | <codeline lineno="11"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dt(i)<sp/>=<sp/>Data(rowid(i),time-delays(i));</highlight></codeline> |
---|
50 | <codeline lineno="12"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
51 | <codeline lineno="13"><highlight class="normal">}</highlight></codeline> |
---|
52 | <codeline lineno="14"><highlight class="normal"></highlight></codeline> |
---|
53 | <codeline lineno="15" refid="classMemDS_1900f1e1c9eb950f87e557c068628e60e" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classMemDS_123522b9e7dd0bb0c365cc9cde4c05449" kindref="member" tooltip="Returns full vector of observed data.">MemDS::getdata</ref>(vec<sp/>&dt,ivec<sp/>&indeces){</highlight></codeline> |
---|
54 | <codeline lineno="16"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>j,i;</highlight></codeline> |
---|
55 | <codeline lineno="17"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug(dt.length()==indeces.length(),<sp/></highlight><highlight class="stringliteral">"MemDS:getdata<sp/>incompatible<sp/>dt"</highlight><highlight class="normal">);</highlight></codeline> |
---|
56 | <codeline lineno="18"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;i<indeces.length();i++){</highlight></codeline> |
---|
57 | <codeline lineno="19"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>j<sp/>=<sp/>indeces<sp/>(i);</highlight></codeline> |
---|
58 | <codeline lineno="20"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dt(i)<sp/>=<sp/>Data(rowid(j),time-delays(j));</highlight></codeline> |
---|
59 | <codeline lineno="21"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline> |
---|
60 | <codeline lineno="22"><highlight class="normal">}</highlight></codeline> |
---|
61 | <codeline lineno="23"><highlight class="normal"></highlight></codeline> |
---|
62 | <codeline lineno="24" refid="classMemDS_121916feb3e5ff960855c09b06a0d279b" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classMemDS_121916feb3e5ff960855c09b06a0d279b" kindref="member" tooltip="Moves from to , i.e. perfroms the actions and reads response of the system.">MemDS::step</ref>()<sp/>{</highlight></codeline> |
---|
63 | <codeline lineno="25"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(time<Data.cols())<sp/>{time++;}</highlight></codeline> |
---|
64 | <codeline lineno="26"><highlight class="normal">}</highlight></codeline> |
---|
65 | <codeline lineno="27"><highlight class="normal"></highlight></codeline> |
---|
66 | <codeline lineno="28" refid="classMemDS_15f72b555e0e4a61de1440c457cf57007" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classMemDS_15f72b555e0e4a61de1440c457cf57007" kindref="member" tooltip="Method that assigns random variables to the datasource. Typically, the datasource...">MemDS::linkrvs</ref>(<ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&drv,<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>&urv)<sp/>{</highlight></codeline> |
---|
67 | <codeline lineno="29"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug(drv.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>()==rowid.length(),</highlight><highlight class="stringliteral">"MemDS::linkrvs<sp/>incompatible<sp/>drv"</highlight><highlight class="normal">);</highlight></codeline> |
---|
68 | <codeline lineno="30"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug(urv.<ref refid="classRV_1f5c7b8bd589eef09ccdf3329a0addea0" kindref="member" tooltip="Return number of scalars in the RV.">count</ref>()==0,</highlight><highlight class="stringliteral">"MemDS<sp/>does<sp/>not<sp/>support<sp/>urv."</highlight><highlight class="normal">);</highlight></codeline> |
---|
69 | <codeline lineno="31"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
70 | <codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classDS_11012025a1a3a1fdd24aa48698a3d3454" kindref="member" tooltip="Observed variables, returned by getdata().">Drv</ref><sp/>=<sp/>drv;</highlight></codeline> |
---|
71 | <codeline lineno="33"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classDS_10a88ffaeb3c7c2cf30c69bc41a000629" kindref="member" tooltip="Action variables, accepted by write().">Urv</ref><sp/>=<sp/>urv;</highlight></codeline> |
---|
72 | <codeline lineno="34"><highlight class="normal">}</highlight></codeline> |
---|
73 | <codeline lineno="35"><highlight class="normal"></highlight></codeline> |
---|
74 | <codeline lineno="36" refid="classMemDS_184cfba80cb32d07be94690658175e9c4" refkind="member"><highlight class="normal"><ref refid="classMemDS_184cfba80cb32d07be94690658175e9c4" kindref="member" tooltip="Default constructor.">MemDS::MemDS</ref>(mat<sp/>&Dat,<sp/>ivec<sp/>&rowid,<sp/>ivec<sp/>&delays){</highlight></codeline> |
---|
75 | <codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug(max(rowid)<=Dat.rows(),</highlight><highlight class="stringliteral">"MemDS<sp/>rowid<sp/>is<sp/>too<sp/>high<sp/>for<sp/>given<sp/>Dat."</highlight><highlight class="normal">);</highlight></codeline> |
---|
76 | <codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>it_assert_debug(max(delays)<Dat.cols(),</highlight><highlight class="stringliteral">"MemDS<sp/>delays<sp/>are<sp/>too<sp/>high."</highlight><highlight class="normal">);</highlight></codeline> |
---|
77 | <codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline> |
---|
78 | <codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>time<sp/>=<sp/>max(delays);<sp/></highlight></codeline> |
---|
79 | <codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Data<sp/>=<sp/>Dat;</highlight></codeline> |
---|
80 | <codeline lineno="42"><highlight class="normal">}</highlight></codeline> |
---|
81 | </programlisting> |
---|
82 | <location file="/home/smidl/work/git/mixpp/bdm/stat/libDS.cpp"/> |
---|
83 | </compounddef> |
---|
84 | </doxygen> |
---|