1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
3 | <head> |
---|
4 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
---|
5 | <title>mixpp: datasources.h Source File</title> |
---|
6 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
---|
7 | <link href="doxygen.css" rel="stylesheet" type="text/css"/> |
---|
8 | </head> |
---|
9 | <body> |
---|
10 | <!-- Generated by Doxygen 1.6.1 --> |
---|
11 | <script type="text/javascript"> |
---|
12 | <!-- |
---|
13 | function changeDisplayState (e){ |
---|
14 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
15 | var button=this.firstChild; |
---|
16 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
17 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
18 | sectionDiv.style.display='block'; |
---|
19 | button.src='open.gif'; |
---|
20 | }else{ |
---|
21 | sectionDiv.style.display='none'; |
---|
22 | button.src='closed.gif'; |
---|
23 | } |
---|
24 | } |
---|
25 | function initDynSections(){ |
---|
26 | var divs=document.getElementsByTagName('div'); |
---|
27 | var sectionCounter=1; |
---|
28 | for(var i=0;i<divs.length-1;i++){ |
---|
29 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
30 | var header=divs[i]; |
---|
31 | var section=divs[i+1]; |
---|
32 | var button=header.firstChild; |
---|
33 | if (button!='IMG'){ |
---|
34 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
35 | button=document.createElement('img'); |
---|
36 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
37 | } |
---|
38 | header.style.cursor='pointer'; |
---|
39 | header.onclick=changeDisplayState; |
---|
40 | header.id='dynheader'+sectionCounter; |
---|
41 | button.src='closed.gif'; |
---|
42 | section.id='dynsection'+sectionCounter; |
---|
43 | section.style.display='none'; |
---|
44 | section.style.marginLeft='14px'; |
---|
45 | sectionCounter++; |
---|
46 | } |
---|
47 | } |
---|
48 | } |
---|
49 | window.onload = initDynSections; |
---|
50 | --> |
---|
51 | </script> |
---|
52 | <div class="navigation" id="top"> |
---|
53 | <div class="tabs"> |
---|
54 | <ul> |
---|
55 | <li><a href="main.html"><span>Main Page</span></a></li> |
---|
56 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
57 | <li><a href="annotated.html"><span>Classes</span></a></li> |
---|
58 | <li class="current"><a href="files.html"><span>Files</span></a></li> |
---|
59 | </ul> |
---|
60 | </div> |
---|
61 | <div class="tabs"> |
---|
62 | <ul> |
---|
63 | <li><a href="files.html"><span>File List</span></a></li> |
---|
64 | <li><a href="globals.html"><span>File Members</span></a></li> |
---|
65 | </ul> |
---|
66 | </div> |
---|
67 | <h1>datasources.h</h1><a href="datasources_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 |
---|
68 | <a name="l00013"></a>00013 <span class="preprocessor">#ifndef DATASOURCE_H</span> |
---|
69 | <a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define DATASOURCE_H</span> |
---|
70 | <a name="l00015"></a>00015 <span class="preprocessor"></span> |
---|
71 | <a name="l00016"></a>00016 |
---|
72 | <a name="l00017"></a>00017 <span class="preprocessor">#include "../base/bdmbase.h"</span> |
---|
73 | <a name="l00018"></a>00018 <span class="preprocessor">#include "../stat/exp_family.h"</span> |
---|
74 | <a name="l00019"></a>00019 <span class="preprocessor">#include "../base/user_info.h"</span> |
---|
75 | <a name="l00020"></a>00020 |
---|
76 | <a name="l00021"></a>00021 <span class="keyword">namespace </span>bdm { |
---|
77 | <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> { |
---|
78 | <a name="l00030"></a>00030 <span class="keyword">protected</span>: |
---|
79 | <a name="l00032"></a><a class="code" href="classbdm_1_1MemDS.html#aa724f4cbfc32e79bacc044253234e260">00032</a> mat <a class="code" href="classbdm_1_1MemDS.html#aa724f4cbfc32e79bacc044253234e260" title="internal matrix of data">Data</a>; |
---|
80 | <a name="l00034"></a><a class="code" href="classbdm_1_1MemDS.html#a681ee3831f68f4f20ed54e04e8b3f107">00034</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1MemDS.html#a681ee3831f68f4f20ed54e04e8b3f107" title="active column in the Data matrix">time</a>; |
---|
81 | <a name="l00036"></a><a class="code" href="classbdm_1_1MemDS.html#a865814d49913dcf672bb20a4334d3dc4">00036</a> ivec <a class="code" href="classbdm_1_1MemDS.html#a865814d49913dcf672bb20a4334d3dc4" title="vector of rows that are presented in Dt">rowid</a>; |
---|
82 | <a name="l00037"></a>00037 |
---|
83 | <a name="l00038"></a>00038 <span class="keyword">public</span>: |
---|
84 | <a name="l00039"></a><a class="code" href="classbdm_1_1MemDS.html#a339a488b93f2fc37c80d9a9573fbd421">00039</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1MemDS.html#a339a488b93f2fc37c80d9a9573fbd421" title="Returns maximum number of provided data, by default it is set to maximum allowed...">max_length</a>() {<span class="keywordflow">return</span> <a class="code" href="classbdm_1_1MemDS.html#aa724f4cbfc32e79bacc044253234e260" title="internal matrix of data">Data</a>.cols();} |
---|
85 | <a name="l00040"></a>00040 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#a23522b9e7dd0bb0c365cc9cde4c05449" title="Returns full vector of observed data=[output, input].">getdata</a> ( vec &dt ); |
---|
86 | <a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#a23522b9e7dd0bb0c365cc9cde4c05449" title="Returns full vector of observed data=[output, input].">getdata</a> ( vec &dt, <span class="keyword">const</span> ivec &indeces ); |
---|
87 | <a name="l00042"></a>00042 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#ae0796d428a29a0393173b453a6bb44b7" title="set random variables">set_drv</a> (<span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &drv,<span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> &urv ); |
---|
88 | <a name="l00043"></a>00043 |
---|
89 | <a name="l00044"></a><a class="code" href="classbdm_1_1MemDS.html#a804e92e86e6417d17214b2c9991e271d">00044</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#a804e92e86e6417d17214b2c9991e271d" title="Accepts action variable and schedule it for application.">write</a> ( <span class="keyword">const</span> vec &ut ) { |
---|
90 | <a name="l00045"></a>00045 <a class="code" href="bdmerror_8h.html#a7c43f3a72afe68ab0c85663a1bb3521a" title="Unconditionally throw std::runtime_error.">bdm_error</a> ( <span class="stringliteral">"MemDS::write is not supported"</span> ); |
---|
91 | <a name="l00046"></a>00046 } |
---|
92 | <a name="l00047"></a>00047 |
---|
93 | <a name="l00048"></a><a class="code" href="classbdm_1_1MemDS.html#a58d81dfe567ecd2cc32f500b038dcedf">00048</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#a58d81dfe567ecd2cc32f500b038dcedf" title="Accepts action variables at specific indeces.">write</a> ( <span class="keyword">const</span> vec &ut, <span class="keyword">const</span> ivec &indices ) { |
---|
94 | <a name="l00049"></a>00049 <a class="code" href="bdmerror_8h.html#a7c43f3a72afe68ab0c85663a1bb3521a" title="Unconditionally throw std::runtime_error.">bdm_error</a> ( <span class="stringliteral">"MemDS::write is not supported"</span> ); |
---|
95 | <a name="l00050"></a>00050 } |
---|
96 | <a name="l00051"></a>00051 |
---|
97 | <a name="l00052"></a>00052 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#a21916feb3e5ff960855c09b06a0d279b" title="Moves from to , i.e. perfroms the actions and reads response of the system.">step</a>(); |
---|
98 | <a name="l00054"></a><a class="code" href="classbdm_1_1MemDS.html#a1ea231f4066652996cde4826560d93e3">00054</a> <a class="code" href="classbdm_1_1MemDS.html#a1ea231f4066652996cde4826560d93e3" title="Default constructor.">MemDS</a> () {}; |
---|
99 | <a name="l00056"></a>00056 <a class="code" href="classbdm_1_1MemDS.html#a1ea231f4066652996cde4826560d93e3" title="Default constructor.">MemDS</a> ( mat &Dat, ivec &rowid0); |
---|
100 | <a name="l00081"></a><a class="code" href="classbdm_1_1MemDS.html#afaebfe6d7a2a43421be05d8cf7d7ae45">00081</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MemDS.html#afaebfe6d7a2a43421be05d8cf7d7ae45">from_setting</a>(<span class="keyword">const</span> Setting &<span class="keyword">set</span>){ |
---|
101 | <a name="l00082"></a>00082 <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a>(<a class="code" href="classbdm_1_1MemDS.html#aa724f4cbfc32e79bacc044253234e260" title="internal matrix of data">Data</a>, <span class="keyword">set</span>, <span class="stringliteral">"Data"</span>, UI::compulsory); |
---|
102 | <a name="l00083"></a>00083 <span class="keywordflow">if</span>(!<a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a>(<a class="code" href="classbdm_1_1MemDS.html#a681ee3831f68f4f20ed54e04e8b3f107" title="active column in the Data matrix">time</a>, <span class="keyword">set</span>,<span class="stringliteral">"time"</span>, UI::optional)) {<a class="code" href="classbdm_1_1MemDS.html#a681ee3831f68f4f20ed54e04e8b3f107" title="active column in the Data matrix">time</a> =0;} |
---|
103 | <a name="l00084"></a>00084 <span class="keywordflow">if</span>(!<a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a>(<a class="code" href="classbdm_1_1MemDS.html#a865814d49913dcf672bb20a4334d3dc4" title="vector of rows that are presented in Dt">rowid</a>, <span class="keyword">set</span>, <span class="stringliteral">"rowid"</span>,UI::optional)) {<a class="code" href="classbdm_1_1MemDS.html#a865814d49913dcf672bb20a4334d3dc4" title="vector of rows that are presented in Dt">rowid</a> =linspace(0,<a class="code" href="classbdm_1_1MemDS.html#aa724f4cbfc32e79bacc044253234e260" title="internal matrix of data">Data</a>.rows()-1);} |
---|
104 | <a name="l00085"></a>00085 <a class="code" href="classbdm_1_1shared__ptr.html" title="A naive implementation of roughly a subset of the std::tr1::shared_ptr spec.">shared_ptr<RV></a> r=UI::build<RV>(<span class="keyword">set</span>,<span class="stringliteral">"drv"</span>,UI::optional); |
---|
105 | <a name="l00086"></a>00086 <span class="keywordflow">if</span> (!r) {r=<span class="keyword">new</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a>(); |
---|
106 | <a name="l00087"></a>00087 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i<<a class="code" href="classbdm_1_1MemDS.html#a865814d49913dcf672bb20a4334d3dc4" title="vector of rows that are presented in Dt">rowid</a>.length(); i++){ r->add(<a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a>(<span class="stringliteral">"ch"</span>+num2str(<a class="code" href="classbdm_1_1MemDS.html#a865814d49913dcf672bb20a4334d3dc4" title="vector of rows that are presented in Dt">rowid</a>(i)), 1, 0));} |
---|
107 | <a name="l00088"></a>00088 } |
---|
108 | <a name="l00089"></a>00089 <a class="code" href="classbdm_1_1MemDS.html#ae0796d428a29a0393173b453a6bb44b7" title="set random variables">set_drv</a>(*r,<a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a>()); <span class="comment">//empty urv</span> |
---|
109 | <a name="l00090"></a>00090 <a class="code" href="classbdm_1_1DS.html#af96cae44624e79638a91ec4f2c7c81a9" title="size of data returned by getdata() ">dtsize</a>=r->_dsize(); |
---|
110 | <a name="l00091"></a>00091 <a class="code" href="classbdm_1_1DS.html#ad7467046a0bd05bc992cc5e1bdedb983" title="size of data">utsize</a>=0; |
---|
111 | <a name="l00092"></a>00092 } |
---|
112 | <a name="l00093"></a>00093 }; |
---|
113 | <a name="l00094"></a>00094 <a class="code" href="user__info_8h.html#a4f9de2f17e844047726487b99def99c6" title="Macro for registration of class into map of user-infos, registered class is scriptable...">UIREGISTER</a>(MemDS); |
---|
114 | <a name="l00095"></a>00095 |
---|
115 | <a name="l00101"></a><a class="code" href="classbdm_1_1EpdfDS.html">00101</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1EpdfDS.html" title="Simulate data from a static pdf (epdf).">EpdfDS</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> { |
---|
116 | <a name="l00102"></a>00102 <span class="keyword">protected</span>: |
---|
117 | <a name="l00104"></a><a class="code" href="classbdm_1_1EpdfDS.html#a83784c6ca9d311a38ff768cb0718c5b5">00104</a> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr<epdf></a> <a class="code" href="classbdm_1_1EpdfDS.html#a83784c6ca9d311a38ff768cb0718c5b5" title="internal pointer to epdf from which we samplecond">iepdf</a>; |
---|
118 | <a name="l00106"></a><a class="code" href="classbdm_1_1EpdfDS.html#a67637d64bcabf6ecb4a80284dc60dc3f">00106</a> vec <a class="code" href="classbdm_1_1EpdfDS.html#a67637d64bcabf6ecb4a80284dc60dc3f" title="internal storage of data sample">dt</a>; |
---|
119 | <a name="l00107"></a>00107 <span class="keyword">public</span>: |
---|
120 | <a name="l00108"></a><a class="code" href="classbdm_1_1EpdfDS.html#aa1bd25d052dd50da9854d78e2f2096d0">00108</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1EpdfDS.html#aa1bd25d052dd50da9854d78e2f2096d0" title="Moves from to , i.e. perfroms the actions and reads response of the system.">step</a>() { |
---|
121 | <a name="l00109"></a>00109 <a class="code" href="classbdm_1_1EpdfDS.html#a67637d64bcabf6ecb4a80284dc60dc3f" title="internal storage of data sample">dt</a>=<a class="code" href="classbdm_1_1EpdfDS.html#a83784c6ca9d311a38ff768cb0718c5b5" title="internal pointer to epdf from which we samplecond">iepdf</a>->sample(); |
---|
122 | <a name="l00110"></a>00110 } |
---|
123 | <a name="l00111"></a><a class="code" href="classbdm_1_1EpdfDS.html#a62c4a9d343dd773c4e75b5f2338b9ba7">00111</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1EpdfDS.html#a62c4a9d343dd773c4e75b5f2338b9ba7" title="Returns full vector of observed data=[output, input].">getdata</a> ( vec &dt_out ) { |
---|
124 | <a name="l00112"></a>00112 dt_out = <a class="code" href="classbdm_1_1EpdfDS.html#a67637d64bcabf6ecb4a80284dc60dc3f" title="internal storage of data sample">dt</a>; |
---|
125 | <a name="l00113"></a>00113 } |
---|
126 | <a name="l00114"></a><a class="code" href="classbdm_1_1EpdfDS.html#a5b3d9370351ca393d4df6f6da6ac5f99">00114</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1EpdfDS.html#a5b3d9370351ca393d4df6f6da6ac5f99" title="Returns data records at indeces.">getdata</a> ( vec &dt_out, <span class="keyword">const</span> ivec &ids ) { |
---|
127 | <a name="l00115"></a>00115 dt_out = <a class="code" href="classbdm_1_1EpdfDS.html#a67637d64bcabf6ecb4a80284dc60dc3f" title="internal storage of data sample">dt</a> ( ids ); |
---|
128 | <a name="l00116"></a>00116 } |
---|
129 | <a name="l00117"></a><a class="code" href="classbdm_1_1EpdfDS.html#a02e3e210884bbdc8134a2a23cc41dd34">00117</a> <span class="keyword">const</span> <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a>& <a class="code" href="classbdm_1_1EpdfDS.html#a02e3e210884bbdc8134a2a23cc41dd34" title="access function">_drv</a>()<span class="keyword"> const </span>{ |
---|
130 | <a name="l00118"></a>00118 <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1EpdfDS.html#a83784c6ca9d311a38ff768cb0718c5b5" title="internal pointer to epdf from which we samplecond">iepdf</a>->_rv(); |
---|
131 | <a name="l00119"></a>00119 } |
---|
132 | <a name="l00120"></a>00120 |
---|
133 | <a name="l00128"></a><a class="code" href="classbdm_1_1EpdfDS.html#a3fdfb570b5d12332b2ba5662d17badac">00128</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1EpdfDS.html#a3fdfb570b5d12332b2ba5662d17badac">from_setting</a> ( <span class="keyword">const</span> Setting &<span class="keyword">set</span> ) { |
---|
134 | <a name="l00129"></a>00129 <a class="code" href="classbdm_1_1EpdfDS.html#a83784c6ca9d311a38ff768cb0718c5b5" title="internal pointer to epdf from which we samplecond">iepdf</a>=UI::build<epdf> ( <span class="keyword">set</span>,<span class="stringliteral">"epdf"</span>,UI::compulsory ); |
---|
135 | <a name="l00130"></a>00130 <a class="code" href="bdmerror_8h.html#a7a3399d182b8e3065532596e76f84849" title="Throw std::runtime_exception if t is not true.">bdm_assert</a>(<a class="code" href="classbdm_1_1EpdfDS.html#a83784c6ca9d311a38ff768cb0718c5b5" title="internal pointer to epdf from which we samplecond">iepdf</a>->isnamed(), <span class="stringliteral">"Input epdf must be named, check if RV is given correctly"</span>); |
---|
136 | <a name="l00131"></a>00131 <a class="code" href="classbdm_1_1EpdfDS.html#a67637d64bcabf6ecb4a80284dc60dc3f" title="internal storage of data sample">dt</a> = zeros(<a class="code" href="classbdm_1_1EpdfDS.html#a83784c6ca9d311a38ff768cb0718c5b5" title="internal pointer to epdf from which we samplecond">iepdf</a>->dimension()); |
---|
137 | <a name="l00132"></a>00132 <a class="code" href="classbdm_1_1DS.html#af96cae44624e79638a91ec4f2c7c81a9" title="size of data returned by getdata() ">dtsize</a>=dt.length(); |
---|
138 | <a name="l00133"></a>00133 <a class="code" href="classbdm_1_1DS.html#a3a92d77fd97fdb6bf1c8edb1e38c6bbc" title="set random variables">set_drv</a>(<a class="code" href="classbdm_1_1EpdfDS.html#a83784c6ca9d311a38ff768cb0718c5b5" title="internal pointer to epdf from which we samplecond">iepdf</a>->_rv(),<a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a>()); |
---|
139 | <a name="l00134"></a>00134 <a class="code" href="classbdm_1_1DS.html#ad7467046a0bd05bc992cc5e1bdedb983" title="size of data">utsize</a> =0; |
---|
140 | <a name="l00135"></a>00135 <a class="code" href="classbdm_1_1EpdfDS.html#a0a35af977871319479542183fde6a647" title="This method TODO.">validate</a>(); |
---|
141 | <a name="l00136"></a>00136 } |
---|
142 | <a name="l00137"></a><a class="code" href="classbdm_1_1EpdfDS.html#a0a35af977871319479542183fde6a647">00137</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1EpdfDS.html#a0a35af977871319479542183fde6a647" title="This method TODO.">validate</a>() { |
---|
143 | <a name="l00138"></a>00138 <a class="code" href="classbdm_1_1EpdfDS.html#a67637d64bcabf6ecb4a80284dc60dc3f" title="internal storage of data sample">dt</a> = <a class="code" href="classbdm_1_1EpdfDS.html#a83784c6ca9d311a38ff768cb0718c5b5" title="internal pointer to epdf from which we samplecond">iepdf</a>->sample(); |
---|
144 | <a name="l00139"></a>00139 } |
---|
145 | <a name="l00140"></a>00140 }; |
---|
146 | <a name="l00141"></a>00141 <a class="code" href="user__info_8h.html#a4f9de2f17e844047726487b99def99c6" title="Macro for registration of class into map of user-infos, registered class is scriptable...">UIREGISTER</a> ( EpdfDS ); |
---|
147 | <a name="l00142"></a>00142 |
---|
148 | <a name="l00146"></a><a class="code" href="classbdm_1_1MpdfDS.html">00146</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1MpdfDS.html" title="Simulate data from conditional density Still having only one density but allowing...">MpdfDS</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> { |
---|
149 | <a name="l00147"></a>00147 <span class="keyword">protected</span>: |
---|
150 | <a name="l00149"></a><a class="code" href="classbdm_1_1MpdfDS.html#a7b91950fa4c2c323df69a6bc9a6a04ac">00149</a> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr<mpdf></a> <a class="code" href="classbdm_1_1MpdfDS.html#a7b91950fa4c2c323df69a6bc9a6a04ac" title="internal pointer to epdf from which we samplecond">impdf</a>; |
---|
151 | <a name="l00151"></a><a class="code" href="classbdm_1_1MpdfDS.html#a959cfe345bf0f165ff80f687826e1082">00151</a> vec <a class="code" href="classbdm_1_1MpdfDS.html#a959cfe345bf0f165ff80f687826e1082" title="internal storage of data sample">yt</a>; |
---|
152 | <a name="l00153"></a><a class="code" href="classbdm_1_1MpdfDS.html#a27751c04183acab85bdaf3598f47a417">00153</a> vec <a class="code" href="classbdm_1_1MpdfDS.html#a27751c04183acab85bdaf3598f47a417" title="input vector">ut</a>; |
---|
153 | <a name="l00155"></a><a class="code" href="classbdm_1_1MpdfDS.html#a54e70167144e692877e7b49633219d5a">00155</a> <a class="code" href="classbdm_1_1datalink__buffered.html" title="Datalink that buffers delayed values - do not forget to call step().">datalink_buffered</a> <a class="code" href="classbdm_1_1MpdfDS.html#a54e70167144e692877e7b49633219d5a" title="datalink between ut and regressor">ut2rgr</a>; |
---|
154 | <a name="l00157"></a><a class="code" href="classbdm_1_1MpdfDS.html#a6ccbcf01b1cd5bd3500aefc3091d9a2b">00157</a> <a class="code" href="classbdm_1_1datalink__buffered.html" title="Datalink that buffers delayed values - do not forget to call step().">datalink_buffered</a> <a class="code" href="classbdm_1_1MpdfDS.html#a6ccbcf01b1cd5bd3500aefc3091d9a2b" title="datalink between yt and regressor">yt2rgr</a>; |
---|
155 | <a name="l00159"></a><a class="code" href="classbdm_1_1MpdfDS.html#a1fffeda455aa454c4509ff69fa9ccb3e">00159</a> vec <a class="code" href="classbdm_1_1MpdfDS.html#a1fffeda455aa454c4509ff69fa9ccb3e" title="numeric values of regressor">rgr</a>; |
---|
156 | <a name="l00160"></a>00160 |
---|
157 | <a name="l00161"></a>00161 <span class="keyword">public</span>: |
---|
158 | <a name="l00162"></a><a class="code" href="classbdm_1_1MpdfDS.html#a9dfd98688d14f647c613bf63a95a19b6">00162</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MpdfDS.html#a9dfd98688d14f647c613bf63a95a19b6" title="Moves from to , i.e. perfroms the actions and reads response of the system.">step</a>() { |
---|
159 | <a name="l00163"></a>00163 <a class="code" href="classbdm_1_1MpdfDS.html#a6ccbcf01b1cd5bd3500aefc3091d9a2b" title="datalink between yt and regressor">yt2rgr</a>.<a class="code" href="classbdm_1_1datalink__buffered.html#af137706c55891ba8a8aecc52ea96865f" title="push current data to history">step</a>(<a class="code" href="classbdm_1_1MpdfDS.html#a959cfe345bf0f165ff80f687826e1082" title="internal storage of data sample">yt</a>); <span class="comment">// y is now history</span> |
---|
160 | <a name="l00164"></a>00164 <a class="code" href="classbdm_1_1MpdfDS.html#a54e70167144e692877e7b49633219d5a" title="datalink between ut and regressor">ut2rgr</a>.<a class="code" href="classbdm_1_1datalink__buffered.html#a681745a319728a416486df38aacd579f" title="Get val for vector val_down from val of &quot;Up&quot;.">filldown</a> ( <a class="code" href="classbdm_1_1MpdfDS.html#a27751c04183acab85bdaf3598f47a417" title="input vector">ut</a>,<a class="code" href="classbdm_1_1MpdfDS.html#a1fffeda455aa454c4509ff69fa9ccb3e" title="numeric values of regressor">rgr</a> ); |
---|
161 | <a name="l00165"></a>00165 <a class="code" href="classbdm_1_1MpdfDS.html#a6ccbcf01b1cd5bd3500aefc3091d9a2b" title="datalink between yt and regressor">yt2rgr</a>.<a class="code" href="classbdm_1_1datalink__buffered.html#a681745a319728a416486df38aacd579f" title="Get val for vector val_down from val of &quot;Up&quot;.">filldown</a> ( <a class="code" href="classbdm_1_1MpdfDS.html#a959cfe345bf0f165ff80f687826e1082" title="internal storage of data sample">yt</a>,<a class="code" href="classbdm_1_1MpdfDS.html#a1fffeda455aa454c4509ff69fa9ccb3e" title="numeric values of regressor">rgr</a> ); |
---|
162 | <a name="l00166"></a>00166 <a class="code" href="classbdm_1_1MpdfDS.html#a959cfe345bf0f165ff80f687826e1082" title="internal storage of data sample">yt</a>=<a class="code" href="classbdm_1_1MpdfDS.html#a7b91950fa4c2c323df69a6bc9a6a04ac" title="internal pointer to epdf from which we samplecond">impdf</a>->samplecond ( <a class="code" href="classbdm_1_1MpdfDS.html#a1fffeda455aa454c4509ff69fa9ccb3e" title="numeric values of regressor">rgr</a> ); |
---|
163 | <a name="l00167"></a>00167 <a class="code" href="classbdm_1_1MpdfDS.html#a54e70167144e692877e7b49633219d5a" title="datalink between ut and regressor">ut2rgr</a>.<a class="code" href="classbdm_1_1datalink__buffered.html#af137706c55891ba8a8aecc52ea96865f" title="push current data to history">step</a>(<a class="code" href="classbdm_1_1MpdfDS.html#a27751c04183acab85bdaf3598f47a417" title="input vector">ut</a>); <span class="comment">//u is now history</span> |
---|
164 | <a name="l00168"></a>00168 } |
---|
165 | <a name="l00169"></a><a class="code" href="classbdm_1_1MpdfDS.html#a8752dbb56c269353cd5135349b4f8408">00169</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MpdfDS.html#a8752dbb56c269353cd5135349b4f8408" title="Returns full vector of observed data=[output, input].">getdata</a> ( vec &dt_out ) { |
---|
166 | <a name="l00170"></a>00170 <a class="code" href="bdmerror_8h.html#a89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a>(dt_out.length()>=<a class="code" href="classbdm_1_1DS.html#ad7467046a0bd05bc992cc5e1bdedb983" title="size of data">utsize</a>+<a class="code" href="classbdm_1_1DS.html#a22a4b29aa6e9f3bf17bcc4b28567e8bd" title="size of output">ytsize</a>,<span class="stringliteral">"Short output vector"</span>); |
---|
167 | <a name="l00171"></a>00171 dt_out.set_subvector(0, <a class="code" href="classbdm_1_1MpdfDS.html#a959cfe345bf0f165ff80f687826e1082" title="internal storage of data sample">yt</a>); |
---|
168 | <a name="l00172"></a>00172 dt_out.set_subvector(ytsize, <a class="code" href="classbdm_1_1MpdfDS.html#a27751c04183acab85bdaf3598f47a417" title="input vector">ut</a>); |
---|
169 | <a name="l00173"></a>00173 } |
---|
170 | <a name="l00174"></a><a class="code" href="classbdm_1_1MpdfDS.html#a537d57d48779983e29e55f4482f344ce">00174</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MpdfDS.html#a537d57d48779983e29e55f4482f344ce" title="Accepts action variable and schedule it for application.">write</a>(<span class="keyword">const</span> vec &ut0){<a class="code" href="classbdm_1_1MpdfDS.html#a27751c04183acab85bdaf3598f47a417" title="input vector">ut</a>=ut0;} |
---|
171 | <a name="l00175"></a>00175 |
---|
172 | <a name="l00187"></a><a class="code" href="classbdm_1_1MpdfDS.html#a39ef55fb36da354c93c544129e03f558">00187</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MpdfDS.html#a39ef55fb36da354c93c544129e03f558">from_setting</a> ( <span class="keyword">const</span> Setting &<span class="keyword">set</span> ) { |
---|
173 | <a name="l00188"></a>00188 <a class="code" href="classbdm_1_1MpdfDS.html#a7b91950fa4c2c323df69a6bc9a6a04ac" title="internal pointer to epdf from which we samplecond">impdf</a>=UI::build<mpdf> ( <span class="keyword">set</span>,<span class="stringliteral">"mpdf"</span>,UI::compulsory ); |
---|
174 | <a name="l00189"></a>00189 |
---|
175 | <a name="l00190"></a>00190 <a class="code" href="classbdm_1_1DS.html#aeb9de2a85f0d8257d79d9b68c05c4995" title="Description of output data.">Yrv</a> = <a class="code" href="classbdm_1_1MpdfDS.html#a7b91950fa4c2c323df69a6bc9a6a04ac" title="internal pointer to epdf from which we samplecond">impdf</a>->_rv(); |
---|
176 | <a name="l00191"></a>00191 <span class="comment">// get unique rvs form rvc</span> |
---|
177 | <a name="l00192"></a>00192 <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rgrv0=<a class="code" href="classbdm_1_1MpdfDS.html#a7b91950fa4c2c323df69a6bc9a6a04ac" title="internal pointer to epdf from which we samplecond">impdf</a>->_rvc().remove_time(); |
---|
178 | <a name="l00193"></a>00193 <span class="comment">// input is what in not in Yrv</span> |
---|
179 | <a name="l00194"></a>00194 <a class="code" href="classbdm_1_1DS.html#a9ac5970128fd39f4f6226723cd1de702" title="Description of data witten by by write().">Urv</a>=rgrv0.<a class="code" href="classbdm_1_1RV.html#aaec44dabdf0a6d90fbae95e1356eda39" title="Subtract another variable from the current one.">subt</a>(Yrv); |
---|
180 | <a name="l00195"></a>00195 <a class="code" href="classbdm_1_1DS.html#a3a92d77fd97fdb6bf1c8edb1e38c6bbc" title="set random variables">set_drv</a>(Yrv, <a class="code" href="classbdm_1_1DS.html#a9ac5970128fd39f4f6226723cd1de702" title="Description of data witten by by write().">Urv</a>); |
---|
181 | <a name="l00196"></a>00196 <span class="comment">// connect input and output to rvc</span> |
---|
182 | <a name="l00197"></a>00197 <a class="code" href="classbdm_1_1MpdfDS.html#a54e70167144e692877e7b49633219d5a" title="datalink between ut and regressor">ut2rgr</a>.<a class="code" href="classbdm_1_1datalink__buffered.html#aadefa427312905425ebab8531da1846a" title="set connection, rv must be fully present in rv_up">set_connection</a>(<a class="code" href="classbdm_1_1MpdfDS.html#a7b91950fa4c2c323df69a6bc9a6a04ac" title="internal pointer to epdf from which we samplecond">impdf</a>->_rvc(), <a class="code" href="classbdm_1_1DS.html#a9ac5970128fd39f4f6226723cd1de702" title="Description of data witten by by write().">Urv</a>); |
---|
183 | <a name="l00198"></a>00198 <a class="code" href="classbdm_1_1MpdfDS.html#a6ccbcf01b1cd5bd3500aefc3091d9a2b" title="datalink between yt and regressor">yt2rgr</a>.<a class="code" href="classbdm_1_1datalink__buffered.html#aadefa427312905425ebab8531da1846a" title="set connection, rv must be fully present in rv_up">set_connection</a>(<a class="code" href="classbdm_1_1MpdfDS.html#a7b91950fa4c2c323df69a6bc9a6a04ac" title="internal pointer to epdf from which we samplecond">impdf</a>->_rvc(), Yrv); |
---|
184 | <a name="l00199"></a>00199 |
---|
185 | <a name="l00200"></a>00200 <span class="comment">//set history - if given</span> |
---|
186 | <a name="l00201"></a>00201 <a class="code" href="classbdm_1_1shared__ptr.html" title="A naive implementation of roughly a subset of the std::tr1::shared_ptr spec.">shared_ptr<RV></a> rv_ini=UI::build<RV>(<span class="keyword">set</span>,<span class="stringliteral">"init_rv"</span>,UI::optional); |
---|
187 | <a name="l00202"></a>00202 <span class="keywordflow">if</span>(rv_ini){ <span class="comment">// check if </span> |
---|
188 | <a name="l00203"></a>00203 vec val; |
---|
189 | <a name="l00204"></a>00204 <a class="code" href="classbdm_1_1UI.html#acd1667e6fec99ec64dabcb3ca2ff922d">UI::get</a>(val, <span class="keyword">set</span>, <span class="stringliteral">"init_values"</span>, UI::optional); |
---|
190 | <a name="l00205"></a>00205 <span class="keywordflow">if</span> (val.length()!=rv_ini->_dsize()){ |
---|
191 | <a name="l00206"></a>00206 <a class="code" href="bdmerror_8h.html#a7c43f3a72afe68ab0c85663a1bb3521a" title="Unconditionally throw std::runtime_error.">bdm_error</a>(<span class="stringliteral">"init_rv and init_values fields have incompatible sizes"</span>); |
---|
192 | <a name="l00207"></a>00207 } <span class="keywordflow">else</span> { |
---|
193 | <a name="l00208"></a>00208 <a class="code" href="classbdm_1_1MpdfDS.html#a54e70167144e692877e7b49633219d5a" title="datalink between ut and regressor">ut2rgr</a>.<a class="code" href="classbdm_1_1datalink__buffered.html#ac95435dc0781d14529cddde9b2894b6d" title="set history of variable given by rv1 to values of hist.">set_history</a>(*rv_ini, val); |
---|
194 | <a name="l00209"></a>00209 <a class="code" href="classbdm_1_1MpdfDS.html#a6ccbcf01b1cd5bd3500aefc3091d9a2b" title="datalink between yt and regressor">yt2rgr</a>.<a class="code" href="classbdm_1_1datalink__buffered.html#ac95435dc0781d14529cddde9b2894b6d" title="set history of variable given by rv1 to values of hist.">set_history</a>(*rv_ini, val); |
---|
195 | <a name="l00210"></a>00210 } |
---|
196 | <a name="l00211"></a>00211 } |
---|
197 | <a name="l00212"></a>00212 |
---|
198 | <a name="l00213"></a>00213 <a class="code" href="classbdm_1_1MpdfDS.html#a959cfe345bf0f165ff80f687826e1082" title="internal storage of data sample">yt</a> = zeros ( <a class="code" href="classbdm_1_1MpdfDS.html#a7b91950fa4c2c323df69a6bc9a6a04ac" title="internal pointer to epdf from which we samplecond">impdf</a>->dimension() ); |
---|
199 | <a name="l00214"></a>00214 <a class="code" href="classbdm_1_1MpdfDS.html#a1fffeda455aa454c4509ff69fa9ccb3e" title="numeric values of regressor">rgr</a> = zeros ( <a class="code" href="classbdm_1_1MpdfDS.html#a7b91950fa4c2c323df69a6bc9a6a04ac" title="internal pointer to epdf from which we samplecond">impdf</a>->dimensionc() ); |
---|
200 | <a name="l00215"></a>00215 <a class="code" href="classbdm_1_1MpdfDS.html#a27751c04183acab85bdaf3598f47a417" title="input vector">ut</a> = zeros(<a class="code" href="classbdm_1_1DS.html#a9ac5970128fd39f4f6226723cd1de702" title="Description of data witten by by write().">Urv</a>.<a class="code" href="classbdm_1_1RV.html#ade30156104f61d86c94f758861418089" title="total size of a random variable">_dsize</a>()); |
---|
201 | <a name="l00216"></a>00216 |
---|
202 | <a name="l00217"></a>00217 <a class="code" href="classbdm_1_1DS.html#a22a4b29aa6e9f3bf17bcc4b28567e8bd" title="size of output">ytsize</a>=<a class="code" href="classbdm_1_1MpdfDS.html#a959cfe345bf0f165ff80f687826e1082" title="internal storage of data sample">yt</a>.length(); |
---|
203 | <a name="l00218"></a>00218 <a class="code" href="classbdm_1_1DS.html#ad7467046a0bd05bc992cc5e1bdedb983" title="size of data">utsize</a>=ut.length(); |
---|
204 | <a name="l00219"></a>00219 <a class="code" href="classbdm_1_1DS.html#af96cae44624e79638a91ec4f2c7c81a9" title="size of data returned by getdata() ">dtsize</a> = ytsize+<a class="code" href="classbdm_1_1DS.html#ad7467046a0bd05bc992cc5e1bdedb983" title="size of data">utsize</a>; |
---|
205 | <a name="l00220"></a>00220 <a class="code" href="classbdm_1_1MpdfDS.html#a225b78b246515bb36208309003ad4867" title="This method TODO.">validate</a>(); |
---|
206 | <a name="l00221"></a>00221 } |
---|
207 | <a name="l00222"></a><a class="code" href="classbdm_1_1MpdfDS.html#a225b78b246515bb36208309003ad4867">00222</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1MpdfDS.html#a225b78b246515bb36208309003ad4867" title="This method TODO.">validate</a>() { |
---|
208 | <a name="l00223"></a>00223 <span class="comment">//taken from sample() - shift of history is not done here</span> |
---|
209 | <a name="l00224"></a>00224 <a class="code" href="classbdm_1_1MpdfDS.html#a54e70167144e692877e7b49633219d5a" title="datalink between ut and regressor">ut2rgr</a>.<a class="code" href="classbdm_1_1datalink__buffered.html#a681745a319728a416486df38aacd579f" title="Get val for vector val_down from val of &quot;Up&quot;.">filldown</a> ( <a class="code" href="classbdm_1_1MpdfDS.html#a27751c04183acab85bdaf3598f47a417" title="input vector">ut</a>,<a class="code" href="classbdm_1_1MpdfDS.html#a1fffeda455aa454c4509ff69fa9ccb3e" title="numeric values of regressor">rgr</a> ); |
---|
210 | <a name="l00225"></a>00225 <a class="code" href="classbdm_1_1MpdfDS.html#a6ccbcf01b1cd5bd3500aefc3091d9a2b" title="datalink between yt and regressor">yt2rgr</a>.<a class="code" href="classbdm_1_1datalink__buffered.html#a681745a319728a416486df38aacd579f" title="Get val for vector val_down from val of &quot;Up&quot;.">filldown</a> ( <a class="code" href="classbdm_1_1MpdfDS.html#a959cfe345bf0f165ff80f687826e1082" title="internal storage of data sample">yt</a>,<a class="code" href="classbdm_1_1MpdfDS.html#a1fffeda455aa454c4509ff69fa9ccb3e" title="numeric values of regressor">rgr</a> ); |
---|
211 | <a name="l00226"></a>00226 <a class="code" href="classbdm_1_1MpdfDS.html#a959cfe345bf0f165ff80f687826e1082" title="internal storage of data sample">yt</a>=<a class="code" href="classbdm_1_1MpdfDS.html#a7b91950fa4c2c323df69a6bc9a6a04ac" title="internal pointer to epdf from which we samplecond">impdf</a>->samplecond ( <a class="code" href="classbdm_1_1MpdfDS.html#a1fffeda455aa454c4509ff69fa9ccb3e" title="numeric values of regressor">rgr</a> ); |
---|
212 | <a name="l00227"></a>00227 } |
---|
213 | <a name="l00228"></a>00228 }; |
---|
214 | <a name="l00229"></a>00229 <a class="code" href="user__info_8h.html#a4f9de2f17e844047726487b99def99c6" title="Macro for registration of class into map of user-infos, registered class is scriptable...">UIREGISTER</a> ( MpdfDS ); |
---|
215 | <a name="l00230"></a>00230 |
---|
216 | <a name="l00234"></a><a class="code" href="classbdm_1_1FileDS.html">00234</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1FileDS.html">FileDS</a>: <span class="keyword">public</span> <a class="code" href="classbdm_1_1MemDS.html" title="Memory storage of off-line data column-wise.">MemDS</a> { |
---|
217 | <a name="l00235"></a>00235 |
---|
218 | <a name="l00236"></a>00236 <span class="keyword">public</span>: |
---|
219 | <a name="l00237"></a><a class="code" href="classbdm_1_1FileDS.html#a0bf36650e9d1af2d0743ffe8a3fcff14">00237</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1FileDS.html#a0bf36650e9d1af2d0743ffe8a3fcff14" title="Returns full vector of observed data=[output, input].">getdata</a> ( vec &dt ) { |
---|
220 | <a name="l00238"></a>00238 dt = <a class="code" href="classbdm_1_1MemDS.html#aa724f4cbfc32e79bacc044253234e260" title="internal matrix of data">Data</a>.get_col ( <a class="code" href="classbdm_1_1MemDS.html#a681ee3831f68f4f20ed54e04e8b3f107" title="active column in the Data matrix">time</a> ); |
---|
221 | <a name="l00239"></a>00239 } |
---|
222 | <a name="l00240"></a>00240 |
---|
223 | <a name="l00241"></a><a class="code" href="classbdm_1_1FileDS.html#a3c546e8d9eb71e079e046e3d2f69c6c4">00241</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1FileDS.html#a3c546e8d9eb71e079e046e3d2f69c6c4" title="Returns data records at indeces.">getdata</a> ( vec &dt, <span class="keyword">const</span> ivec &indices ) { |
---|
224 | <a name="l00242"></a>00242 vec tmp = <a class="code" href="classbdm_1_1MemDS.html#aa724f4cbfc32e79bacc044253234e260" title="internal matrix of data">Data</a>.get_col ( <a class="code" href="classbdm_1_1MemDS.html#a681ee3831f68f4f20ed54e04e8b3f107" title="active column in the Data matrix">time</a> ); |
---|
225 | <a name="l00243"></a>00243 dt = tmp ( indices ); |
---|
226 | <a name="l00244"></a>00244 } |
---|
227 | <a name="l00245"></a>00245 |
---|
228 | <a name="l00247"></a><a class="code" href="classbdm_1_1FileDS.html#aa6af63065097147b390e684a7842a26a">00247</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1FileDS.html#aa6af63065097147b390e684a7842a26a" title="returns number of data in the file;">ndat</a>() { |
---|
229 | <a name="l00248"></a>00248 <span class="keywordflow">return</span> <a class="code" href="classbdm_1_1MemDS.html#aa724f4cbfc32e79bacc044253234e260" title="internal matrix of data">Data</a>.cols(); |
---|
230 | <a name="l00249"></a>00249 } |
---|
231 | <a name="l00251"></a><a class="code" href="classbdm_1_1FileDS.html#a998f590eeddee97ae6918671e40756b8">00251</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1FileDS.html#a998f590eeddee97ae6918671e40756b8" title="no sense to log this type">log_add</a> ( <a class="code" href="classbdm_1_1logger.html" title="Class for storing results (and semi-results) of an experiment.">logger</a> &L ) {}; |
---|
232 | <a name="l00253"></a><a class="code" href="classbdm_1_1FileDS.html#a59d44ef34a523127dd79c076461c43b6">00253</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1FileDS.html#a59d44ef34a523127dd79c076461c43b6" title="no sense to log this type">logit</a> ( <a class="code" href="classbdm_1_1logger.html" title="Class for storing results (and semi-results) of an experiment.">logger</a> &L ) {}; |
---|
233 | <a name="l00254"></a>00254 }; |
---|
234 | <a name="l00255"></a>00255 |
---|
235 | <a name="l00262"></a><a class="code" href="classbdm_1_1ITppFileDS.html">00262</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1ITppFileDS.html" title="Read Data Matrix from an IT file.">ITppFileDS</a>: <span class="keyword">public</span> <a class="code" href="classbdm_1_1FileDS.html">FileDS</a> { |
---|
236 | <a name="l00263"></a>00263 |
---|
237 | <a name="l00264"></a>00264 <span class="keyword">public</span>: |
---|
238 | <a name="l00266"></a><a class="code" href="classbdm_1_1ITppFileDS.html#a9a1ea166e35aaaa1660905ed7249608c">00266</a> <a class="code" href="classbdm_1_1ITppFileDS.html#a9a1ea166e35aaaa1660905ed7249608c" title="Convenience constructor.">ITppFileDS</a> ( <span class="keyword">const</span> <span class="keywordtype">string</span> &fname, <span class="keyword">const</span> <span class="keywordtype">string</span> &varname ) : <a class="code" href="classbdm_1_1FileDS.html">FileDS</a>() { |
---|
239 | <a name="l00267"></a>00267 it_file it ( fname ); |
---|
240 | <a name="l00268"></a>00268 it << Name ( varname ); |
---|
241 | <a name="l00269"></a>00269 it >> <a class="code" href="classbdm_1_1MemDS.html#aa724f4cbfc32e79bacc044253234e260" title="internal matrix of data">Data</a>; |
---|
242 | <a name="l00270"></a>00270 <a class="code" href="classbdm_1_1MemDS.html#a681ee3831f68f4f20ed54e04e8b3f107" title="active column in the Data matrix">time</a> = 0; |
---|
243 | <a name="l00271"></a>00271 <span class="comment">//rowid and delays are ignored</span> |
---|
244 | <a name="l00272"></a>00272 }; |
---|
245 | <a name="l00273"></a>00273 |
---|
246 | <a name="l00274"></a>00274 <a class="code" href="classbdm_1_1ITppFileDS.html" title="Read Data Matrix from an IT file.">ITppFileDS</a> () : <a class="code" href="classbdm_1_1FileDS.html">FileDS</a>() { |
---|
247 | <a name="l00275"></a>00275 }; |
---|
248 | <a name="l00276"></a>00276 |
---|
249 | <a name="l00277"></a>00277 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1ITppFileDS.html#afd192da176625a909fa853458b604566">from_setting</a> ( <span class="keyword">const</span> Setting &<span class="keyword">set</span> ); |
---|
250 | <a name="l00278"></a>00278 |
---|
251 | <a name="l00279"></a>00279 <span class="comment">// TODO dodelat void to_setting( Setting &set ) const;</span> |
---|
252 | <a name="l00280"></a>00280 |
---|
253 | <a name="l00281"></a>00281 }; |
---|
254 | <a name="l00282"></a>00282 |
---|
255 | <a name="l00283"></a>00283 <a class="code" href="user__info_8h.html#a4f9de2f17e844047726487b99def99c6" title="Macro for registration of class into map of user-infos, registered class is scriptable...">UIREGISTER</a> ( ITppFileDS ); |
---|
256 | <a name="l00284"></a>00284 SHAREDPTR ( ITppFileDS ); |
---|
257 | <a name="l00285"></a>00285 |
---|
258 | <a name="l00293"></a><a class="code" href="classbdm_1_1CsvFileDS.html">00293</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1CsvFileDS.html" title="CSV file data storage The constructor creates Data matrix from the records in a CSV...">CsvFileDS</a>: <span class="keyword">public</span> <a class="code" href="classbdm_1_1FileDS.html">FileDS</a> { |
---|
259 | <a name="l00294"></a>00294 |
---|
260 | <a name="l00295"></a>00295 <span class="keyword">public</span>: |
---|
261 | <a name="l00297"></a>00297 <a class="code" href="classbdm_1_1CsvFileDS.html#a8d9d56cdf6b8d0236e32a80e11c238b0" title="Constructor - create DS from a CSV file.">CsvFileDS</a> ( <span class="keyword">const</span> <span class="keywordtype">string</span>& fname, <span class="keyword">const</span> <span class="keywordtype">string</span>& orientation = <span class="stringliteral">"BY_COL"</span> ); |
---|
262 | <a name="l00298"></a>00298 }; |
---|
263 | <a name="l00299"></a>00299 |
---|
264 | <a name="l00300"></a>00300 |
---|
265 | <a name="l00301"></a>00301 |
---|
266 | <a name="l00302"></a>00302 <span class="comment">// ARXDs - DELETED</span> |
---|
267 | <a name="l00303"></a>00303 |
---|
268 | <a name="l00305"></a><a class="code" href="classbdm_1_1stateDS.html">00305</a> <span class="keyword">class </span><a class="code" href="classbdm_1_1stateDS.html" title="State-space data source simulating two densities.">stateDS</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> { |
---|
269 | <a name="l00306"></a>00306 <span class="keyword">private</span>: |
---|
270 | <a name="l00308"></a>00308 <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr<mpdf></a> IM; |
---|
271 | <a name="l00309"></a>00309 |
---|
272 | <a name="l00311"></a>00311 <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr<mpdf></a> OM; |
---|
273 | <a name="l00312"></a>00312 |
---|
274 | <a name="l00313"></a>00313 <span class="keyword">protected</span>: |
---|
275 | <a name="l00315"></a><a class="code" href="classbdm_1_1stateDS.html#a839bd9979c0aa407bc575e536f0a9918">00315</a> vec <a class="code" href="classbdm_1_1stateDS.html#a839bd9979c0aa407bc575e536f0a9918" title="result storage">dt</a>; |
---|
276 | <a name="l00317"></a><a class="code" href="classbdm_1_1stateDS.html#ac055a609e44f77300aa86e903df4f088">00317</a> vec <a class="code" href="classbdm_1_1stateDS.html#ac055a609e44f77300aa86e903df4f088" title="state storage">xt</a>; |
---|
277 | <a name="l00319"></a><a class="code" href="classbdm_1_1stateDS.html#aabbdb3dcf67a06f5a9003828819bafbf">00319</a> vec <a class="code" href="classbdm_1_1stateDS.html#aabbdb3dcf67a06f5a9003828819bafbf" title="input storage">ut</a>; |
---|
278 | <a name="l00321"></a><a class="code" href="classbdm_1_1stateDS.html#a16cdcdd5c878ebeebe7cad71c87f77ca">00321</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1stateDS.html#a16cdcdd5c878ebeebe7cad71c87f77ca" title="Logger.">L_xt</a>; |
---|
279 | <a name="l00322"></a>00322 |
---|
280 | <a name="l00323"></a>00323 <span class="keyword">public</span>: |
---|
281 | <a name="l00324"></a><a class="code" href="classbdm_1_1stateDS.html#a5c9f4a93313f69adfa97375b58c0a6c2">00324</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1stateDS.html#a5c9f4a93313f69adfa97375b58c0a6c2" title="Returns full vector of observed data=[output, input].">getdata</a> ( vec &dt0 ) { |
---|
282 | <a name="l00325"></a>00325 dt0 = <a class="code" href="classbdm_1_1stateDS.html#a839bd9979c0aa407bc575e536f0a9918" title="result storage">dt</a>; |
---|
283 | <a name="l00326"></a>00326 } |
---|
284 | <a name="l00327"></a>00327 |
---|
285 | <a name="l00328"></a><a class="code" href="classbdm_1_1stateDS.html#ad61e149db7c7b3a1289ac82f37c97700">00328</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1stateDS.html#ad61e149db7c7b3a1289ac82f37c97700" title="Returns data records at indeces.">getdata</a> ( vec &dt0, <span class="keyword">const</span> ivec &indices ) { |
---|
286 | <a name="l00329"></a>00329 dt0 = <a class="code" href="classbdm_1_1stateDS.html#a839bd9979c0aa407bc575e536f0a9918" title="result storage">dt</a> ( indices ); |
---|
287 | <a name="l00330"></a>00330 } |
---|
288 | <a name="l00332"></a><a class="code" href="classbdm_1_1stateDS.html#ace1eec3f47d8d1b8ad9747482a4ca598">00332</a> <a class="code" href="classbdm_1_1stateDS.html" title="State-space data source simulating two densities.">stateDS</a> ( <span class="keyword">const</span> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr<mpdf></a> &IM0, <span class="keyword">const</span> <a class="code" href="classbdm_1_1shared__ptr.html">shared_ptr<mpdf></a> &OM0, <span class="keywordtype">int</span> usize ) : IM ( IM0 ), OM ( OM0 ), |
---|
289 | <a name="l00333"></a>00333 <a class="code" href="classbdm_1_1stateDS.html#a839bd9979c0aa407bc575e536f0a9918" title="result storage">dt</a> ( OM0->dimension() ), <a class="code" href="classbdm_1_1stateDS.html#ac055a609e44f77300aa86e903df4f088" title="state storage">xt</a> ( IM0->dimension() ), |
---|
290 | <a name="l00334"></a>00334 <a class="code" href="classbdm_1_1stateDS.html#aabbdb3dcf67a06f5a9003828819bafbf" title="input storage">ut</a> ( usize ), <a class="code" href="classbdm_1_1stateDS.html#a16cdcdd5c878ebeebe7cad71c87f77ca" title="Logger.">L_xt</a> ( 0 ) { } |
---|
291 | <a name="l00335"></a>00335 |
---|
292 | <a name="l00336"></a>00336 <a class="code" href="classbdm_1_1stateDS.html" title="State-space data source simulating two densities.">stateDS</a>() : <a class="code" href="classbdm_1_1stateDS.html#a16cdcdd5c878ebeebe7cad71c87f77ca" title="Logger.">L_xt</a> ( 0 ) { } |
---|
293 | <a name="l00337"></a>00337 |
---|
294 | <a name="l00338"></a><a class="code" href="classbdm_1_1stateDS.html#a1e98f3e362e35245d565c2508527ae14">00338</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1stateDS.html#a1e98f3e362e35245d565c2508527ae14" title="Moves from to , i.e. perfroms the actions and reads response of the system.">step</a>() { |
---|
295 | <a name="l00339"></a>00339 <a class="code" href="classbdm_1_1stateDS.html#ac055a609e44f77300aa86e903df4f088" title="state storage">xt</a> = IM->samplecond ( concat ( <a class="code" href="classbdm_1_1stateDS.html#ac055a609e44f77300aa86e903df4f088" title="state storage">xt</a>, <a class="code" href="classbdm_1_1stateDS.html#aabbdb3dcf67a06f5a9003828819bafbf" title="input storage">ut</a> ) ); |
---|
296 | <a name="l00340"></a>00340 <a class="code" href="classbdm_1_1stateDS.html#a839bd9979c0aa407bc575e536f0a9918" title="result storage">dt</a> = OM->samplecond ( concat ( <a class="code" href="classbdm_1_1stateDS.html#ac055a609e44f77300aa86e903df4f088" title="state storage">xt</a>, <a class="code" href="classbdm_1_1stateDS.html#aabbdb3dcf67a06f5a9003828819bafbf" title="input storage">ut</a> ) ); |
---|
297 | <a name="l00341"></a>00341 } |
---|
298 | <a name="l00342"></a>00342 |
---|
299 | <a name="l00343"></a><a class="code" href="classbdm_1_1stateDS.html#ac78f44b484128e73fe31ab6d118b5440">00343</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1stateDS.html#ac78f44b484128e73fe31ab6d118b5440" title="Register DS for logging into logger L.">log_add</a> ( <a class="code" href="classbdm_1_1logger.html" title="Class for storing results (and semi-results) of an experiment.">logger</a> &L ) { |
---|
300 | <a name="l00344"></a>00344 <a class="code" href="classbdm_1_1stateDS.html#ac78f44b484128e73fe31ab6d118b5440" title="Register DS for logging into logger L.">DS::log_add</a> ( L ); |
---|
301 | <a name="l00345"></a>00345 <a class="code" href="classbdm_1_1stateDS.html#a16cdcdd5c878ebeebe7cad71c87f77ca" title="Logger.">L_xt</a> = L.<a class="code" href="classbdm_1_1logger.html#a47aa3b098a81d02a8ffaea2c9fa09ac7">add</a> ( IM->_rv(), <span class="stringliteral">"true"</span> ); |
---|
302 | <a name="l00346"></a>00346 } |
---|
303 | <a name="l00347"></a><a class="code" href="classbdm_1_1stateDS.html#a3850341d9584df6b60cb05eeea6b38f4">00347</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1stateDS.html#a3850341d9584df6b60cb05eeea6b38f4" title="Register DS for logging into logger L.">logit</a> ( <a class="code" href="classbdm_1_1logger.html" title="Class for storing results (and semi-results) of an experiment.">logger</a> &L ) { |
---|
304 | <a name="l00348"></a>00348 <a class="code" href="classbdm_1_1stateDS.html#a3850341d9584df6b60cb05eeea6b38f4" title="Register DS for logging into logger L.">DS::logit</a> ( L ); |
---|
305 | <a name="l00349"></a>00349 L.<a class="code" href="classbdm_1_1logger.html#ae30f695619931b3c372ab280e452d309" title="log this vector">logit</a> ( <a class="code" href="classbdm_1_1stateDS.html#a16cdcdd5c878ebeebe7cad71c87f77ca" title="Logger.">L_xt</a>, <a class="code" href="classbdm_1_1stateDS.html#ac055a609e44f77300aa86e903df4f088" title="state storage">xt</a> ); |
---|
306 | <a name="l00350"></a>00350 } |
---|
307 | <a name="l00351"></a>00351 |
---|
308 | <a name="l00381"></a>00381 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1stateDS.html#aa3792e751ff4d3f66f8feec16506197b">from_setting</a> ( <span class="keyword">const</span> Setting &<span class="keyword">set</span> ); |
---|
309 | <a name="l00382"></a>00382 |
---|
310 | <a name="l00383"></a>00383 <span class="comment">// TODO dodelat void to_setting( Setting &set ) const;</span> |
---|
311 | <a name="l00384"></a>00384 |
---|
312 | <a name="l00385"></a>00385 }; |
---|
313 | <a name="l00386"></a>00386 |
---|
314 | <a name="l00387"></a>00387 <a class="code" href="user__info_8h.html#a4f9de2f17e844047726487b99def99c6" title="Macro for registration of class into map of user-infos, registered class is scriptable...">UIREGISTER</a> ( stateDS ); |
---|
315 | <a name="l00388"></a>00388 SHAREDPTR ( stateDS ); |
---|
316 | <a name="l00389"></a>00389 |
---|
317 | <a name="l00390"></a>00390 }; <span class="comment">//namespace</span> |
---|
318 | <a name="l00391"></a>00391 |
---|
319 | <a name="l00392"></a>00392 <span class="preprocessor">#endif // DS_H</span> |
---|
320 | </pre></div></div> |
---|
321 | <hr size="1"/><address style="text-align: right;"><small>Generated on Thu Oct 15 00:07:48 2009 for mixpp by |
---|
322 | <a href="http://www.doxygen.org/index.html"> |
---|
323 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> |
---|
324 | </body> |
---|
325 | </html> |
---|