24 | | <a name="l00018"></a>00018 |
25 | | <a name="l00019"></a>00019 <span class="keyword">namespace </span>bdm{ |
26 | | <a name="l00027"></a><a class="code" href="classbdm_1_1MemDS.html">00027</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1MemDS.html" title="Class representing off-line data stored in memory.">MemDS</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1DS.html" title="Abstract class for discrete-time sources of data.">DS</a> { |
27 | | <a name="l00028"></a>00028 mat Data; |
28 | | <a name="l00029"></a>00029 <span class="keywordtype">int</span> time; |
29 | | <a name="l00030"></a>00030 ivec rowid; |
30 | | <a name="l00031"></a>00031 ivec delays; |
31 | | <a name="l00032"></a>00032 |
32 | | <a name="l00033"></a>00033 <span class="keyword">public</span>: |
33 | | <a name="l00034"></a>00034 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#23522b9e7dd0bb0c365cc9cde4c05449" title="Returns full vector of observed data.">getdata</a>(vec &dt); |
34 | | <a name="l00035"></a>00035 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#23522b9e7dd0bb0c365cc9cde4c05449" title="Returns full vector of observed data.">getdata</a>(vec &dt, ivec &indeces); |
35 | | <a name="l00036"></a>00036 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#5f72b555e0e4a61de1440c457cf57007" title="Method that assigns random variables to the datasource. Typically, the datasource...">linkrvs</a>(<a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &drv, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &urv); |
36 | | <a name="l00037"></a><a class="code" href="classbdm_1_1MemDS.html#9a7f17598fe2b458707ba932865beef5">00037</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#9a7f17598fe2b458707ba932865beef5" title="Accepts action variable and schedule it for application.">write</a>(vec &ut){it_error(<span class="stringliteral">"MemDS::write is not supported"</span>);} |
37 | | <a name="l00038"></a><a class="code" href="classbdm_1_1MemDS.html#d9af4563d430d8a3f15aa03581e52ef0">00038</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#9a7f17598fe2b458707ba932865beef5" title="Accepts action variable and schedule it for application.">write</a>(vec &ut,ivec &indexes){it_error(<span class="stringliteral">"MemDS::write is not supported"</span>);} |
38 | | <a name="l00039"></a>00039 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#21916feb3e5ff960855c09b06a0d279b" title="Moves from to , i.e. perfroms the actions and reads response of the system.">step</a>(); |
39 | | <a name="l00041"></a>00041 <a class="code" href="classbdm_1_1MemDS.html#84cfba80cb32d07be94690658175e9c4" title="Default constructor.">MemDS</a>(mat &Dat, ivec &rowid, ivec &delays); |
40 | | <a name="l00042"></a>00042 }; |
41 | | <a name="l00043"></a>00043 |
42 | | <a name="l00044"></a>00044 }; <span class="comment">//namespace</span> |
43 | | <a name="l00045"></a>00045 |
44 | | <a name="l00046"></a>00046 <span class="preprocessor">#endif // DS_H</span> |
| 25 | <a name="l00018"></a>00018 <span class="preprocessor">#include "<a class="code" href="libEF_8h.html" title="Probability distributions for Exponential Family models.">libEF.h</a>"</span> |
| 26 | <a name="l00019"></a>00019 |
| 27 | <a name="l00020"></a>00020 |
| 28 | <a name="l00021"></a>00021 <span class="keyword">namespace </span>bdm { |
| 29 | <a name="l00029"></a><a class="code" href="classbdm_1_1MemDS.html">00029</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1MemDS.html" title="Memory storage of off-line data column-wise.">MemDS</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1DS.html" title="Abstract class for discrete-time sources of data.">DS</a> { |
| 30 | <a name="l00031"></a>00031 mat Data; |
| 31 | <a name="l00033"></a>00033 <span class="keywordtype">int</span> time; |
| 32 | <a name="l00035"></a>00035 ivec rowid; |
| 33 | <a name="l00037"></a>00037 ivec delays; |
| 34 | <a name="l00038"></a>00038 |
| 35 | <a name="l00039"></a>00039 <span class="keyword">public</span>: |
| 36 | <a name="l00040"></a>00040 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#23522b9e7dd0bb0c365cc9cde4c05449" title="Returns full vector of observed data.">getdata</a> ( vec &dt ); |
| 37 | <a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#23522b9e7dd0bb0c365cc9cde4c05449" title="Returns full vector of observed data.">getdata</a> ( vec &dt, <span class="keyword">const</span> ivec &indeces ); |
| 38 | <a name="l00042"></a>00042 <span class="keywordtype">void</span> linkrvs ( <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &drv, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &urv ); |
| 39 | <a name="l00043"></a><a class="code" href="classbdm_1_1MemDS.html#9a7f17598fe2b458707ba932865beef5">00043</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#9a7f17598fe2b458707ba932865beef5" title="Accepts action variable and schedule it for application.">write</a> ( vec &ut ) {it_error ( <span class="stringliteral">"MemDS::write is not supported"</span> );} |
| 40 | <a name="l00044"></a>00044 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#9a7f17598fe2b458707ba932865beef5" title="Accepts action variable and schedule it for application.">write</a> ( vec &ut,ivec &indexes ) {it_error ( <span class="stringliteral">"MemDS::write is not supported"</span> );} |
| 41 | <a name="l00045"></a>00045 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#21916feb3e5ff960855c09b06a0d279b" title="Moves from to , i.e. perfroms the actions and reads response of the system.">step</a>(); |
| 42 | <a name="l00047"></a>00047 <a class="code" href="classbdm_1_1MemDS.html#84cfba80cb32d07be94690658175e9c4" title="Default constructor.">MemDS</a> ( mat &Dat, ivec &rowid, ivec &delays ); |
| 43 | <a name="l00048"></a>00048 }; |
| 44 | <a name="l00049"></a>00049 |
| 45 | <a name="l00054"></a><a class="code" href="classbdm_1_1ArxDS.html">00054</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1ArxDS.html" title="Generator of ARX data.">ArxDS</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1DS.html" title="Abstract class for discrete-time sources of data.">DS</a> { |
| 46 | <a name="l00056"></a>00056 <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> Rrv; |
| 47 | <a name="l00058"></a>00058 vec Y; |
| 48 | <a name="l00060"></a>00060 vec H; |
| 49 | <a name="l00062"></a>00062 vec rgr; |
| 50 | <a name="l00064"></a>00064 <a class="code" href="classbdm_1_1datalink__e2e.html" title="DataLink is a connection between two data vectors Up and Down.">datalink_e2e</a> rgrlnk; |
| 51 | <a name="l00066"></a>00066 <a class="code" href="classbdm_1_1mlnorm.html" title="Normal distributed linear function with linear function of mean value;.">mlnorm<chmat></a> model; |
| 52 | <a name="l00067"></a>00067 <span class="keyword">public</span>: |
| 53 | <a name="l00068"></a><a class="code" href="classbdm_1_1ArxDS.html#db242e35812c311c8415bb7e31c3f595">00068</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1ArxDS.html#db242e35812c311c8415bb7e31c3f595" title="Returns full vector of observed data.">getdata</a> ( vec &dt ){it_assert_debug(dt.length()==Y.length(),<span class="stringliteral">"ArxDS"</span>); dt=Y;}; |
| 54 | <a name="l00069"></a><a class="code" href="classbdm_1_1ArxDS.html#fd61140869637b91bc23215ab7f45d3b">00069</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1ArxDS.html#db242e35812c311c8415bb7e31c3f595" title="Returns full vector of observed data.">getdata</a> ( vec &dt, <span class="keyword">const</span> ivec &indexes ){it_assert_debug(dt.length()==Y.length(),<span class="stringliteral">"ArxDS"</span>); dt=Y;}; |
| 55 | <a name="l00070"></a><a class="code" href="classbdm_1_1ArxDS.html#8f6da8a00abba70bc58c7a4030bd8940">00070</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1ArxDS.html#8f6da8a00abba70bc58c7a4030bd8940" title="Accepts action variable and schedule it for application.">write</a> ( vec &ut ){it_assert_debug(ut.length()==<a class="code" href="classbdm_1_1DS.html#9ac5970128fd39f4f6226723cd1de702" title="Action variables, accepted by write().">Urv</a>.<a class="code" href="classbdm_1_1RV.html#2174751a00ce19f941edd2c1a861be67" title="Return number of scalars in the RV.">count</a>(),<span class="stringliteral">"ArxDS"</span>); H.set_subvector(0,ut);}; |
| 56 | <a name="l00071"></a><a class="code" href="classbdm_1_1ArxDS.html#7240ea989a6453e58468feea319dcf0b">00071</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1ArxDS.html#8f6da8a00abba70bc58c7a4030bd8940" title="Accepts action variable and schedule it for application.">write</a> ( vec &ut, <span class="keyword">const</span> ivec &indexes ){it_assert_debug(ut.length()==<a class="code" href="classbdm_1_1DS.html#9ac5970128fd39f4f6226723cd1de702" title="Action variables, accepted by write().">Urv</a>.<a class="code" href="classbdm_1_1RV.html#2174751a00ce19f941edd2c1a861be67" title="Return number of scalars in the RV.">count</a>(),<span class="stringliteral">"ArxDS"</span>); set_subvector(H,indexes,ut);}; |
| 57 | <a name="l00072"></a>00072 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1ArxDS.html#57dfa26b23cc03d53b123fa7e0474b19" title="Moves from to , i.e. perfroms the actions and reads response of the system.">step</a>(); |
| 58 | <a name="l00074"></a>00074 <a class="code" href="classbdm_1_1ArxDS.html#e6f17e13dc0c9187ed8dbb19f3c4330a" title="Default constructor.">ArxDS</a> ( <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &drv, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &urv, <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &rrv); |
| 59 | <a name="l00076"></a><a class="code" href="classbdm_1_1ArxDS.html#2d9abc62f1fee862f0e1c60c5c4a3c8a">00076</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1ArxDS.html#2d9abc62f1fee862f0e1c60c5c4a3c8a" title="Set parameters of the internal model.">set_parameters</a>(<span class="keyword">const</span> mat &Th0, <span class="keyword">const</span> vec mu0, <span class="keyword">const</span> <a class="code" href="classchmat.html" title="Symmetric matrix stored in square root decomposition using upper cholesky.">chmat</a> &sqR0) |
| 60 | <a name="l00077"></a>00077 {model.<a class="code" href="classbdm_1_1mlnorm.html#5d18dec3167584338a4775c1d165d96f" title="Set A and R.">set_parameters</a>(Th0, mu0, sqR0); }; |
| 61 | <a name="l00078"></a>00078 }; |
| 62 | <a name="l00079"></a>00079 |
| 63 | <a name="l00080"></a>00080 }; <span class="comment">//namespace</span> |
| 64 | <a name="l00081"></a>00081 |
| 65 | <a name="l00082"></a>00082 <span class="preprocessor">#endif // DS_H</span> |