80 | | <a name="l00029"></a><a class="code" href="classbdm_1_1memlog.html#aa690ebd91430b5973855c9b4c9cf1b1d">00029</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1memlog.html#aa690ebd91430b5973855c9b4c9cf1b1d" title="Maximum length of vectors stored in memory.">maxlen</a>; |
81 | | <a name="l00031"></a><a class="code" href="classbdm_1_1memlog.html#a70cec1d3549a82796ad7b6f0d07a4570">00031</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1memlog.html#a70cec1d3549a82796ad7b6f0d07a4570" title="Currect record to be written.">ind</a>; |
82 | | <a name="l00033"></a><a class="code" href="classbdm_1_1memlog.html#a1fed143162f2de6ef1c1b6557964f24e">00033</a> Array<mat> <a class="code" href="classbdm_1_1memlog.html#a1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a>; |
83 | | <a name="l00035"></a><a class="code" href="classbdm_1_1memlog.html#a11fdf8ffca0f509ff637b0c3ac161c1f">00035</a> <span class="keywordtype">string</span> <a class="code" href="classbdm_1_1memlog.html#a11fdf8ffca0f509ff637b0c3ac161c1f" title="name of it file to save results">itfilename</a>; |
| 77 | <a name="l00029"></a><a class="code" href="classbdm_1_1memlog.html#a690ebd91430b5973855c9b4c9cf1b1d">00029</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1memlog.html#a690ebd91430b5973855c9b4c9cf1b1d" title="Maximum length of vectors stored in memory.">maxlen</a>; |
| 78 | <a name="l00031"></a><a class="code" href="classbdm_1_1memlog.html#70cec1d3549a82796ad7b6f0d07a4570">00031</a> <span class="keywordtype">int</span> <a class="code" href="classbdm_1_1memlog.html#70cec1d3549a82796ad7b6f0d07a4570" title="Currect record to be written.">ind</a>; |
| 79 | <a name="l00033"></a><a class="code" href="classbdm_1_1memlog.html#1fed143162f2de6ef1c1b6557964f24e">00033</a> Array<mat> <a class="code" href="classbdm_1_1memlog.html#1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a>; |
| 80 | <a name="l00035"></a><a class="code" href="classbdm_1_1memlog.html#11fdf8ffca0f509ff637b0c3ac161c1f">00035</a> <span class="keywordtype">string</span> <a class="code" href="classbdm_1_1memlog.html#11fdf8ffca0f509ff637b0c3ac161c1f" title="name of it file to save results">itfilename</a>; |
91 | | <a name="l00045"></a><a class="code" href="classbdm_1_1memlog.html#a69964f0472e53098528ee41507bdfc77">00045</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1memlog.html#a69964f0472e53098528ee41507bdfc77" title="Shifts storage position for another time step.">step</a>() { |
92 | | <a name="l00046"></a>00046 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1memlog.html#a70cec1d3549a82796ad7b6f0d07a4570" title="Currect record to be written.">ind</a> < <a class="code" href="classbdm_1_1memlog.html#aa690ebd91430b5973855c9b4c9cf1b1d" title="Maximum length of vectors stored in memory.">maxlen</a> ) <a class="code" href="classbdm_1_1memlog.html#a70cec1d3549a82796ad7b6f0d07a4570" title="Currect record to be written.">ind</a>++; |
93 | | <a name="l00047"></a>00047 <span class="keywordflow">else</span> <a class="code" href="bdmerror_8h.html#a7c43f3a72afe68ab0c85663a1bb3521a" title="Unconditionally throw std::runtime_error.">bdm_error</a> ( <span class="stringliteral">"memlog::ind is too high;"</span> ); |
| 88 | <a name="l00045"></a><a class="code" href="classbdm_1_1memlog.html#69964f0472e53098528ee41507bdfc77">00045</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1memlog.html#69964f0472e53098528ee41507bdfc77" title="Shifts storage position for another time step.">step</a>() { |
| 89 | <a name="l00046"></a>00046 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1memlog.html#70cec1d3549a82796ad7b6f0d07a4570" title="Currect record to be written.">ind</a> < <a class="code" href="classbdm_1_1memlog.html#a690ebd91430b5973855c9b4c9cf1b1d" title="Maximum length of vectors stored in memory.">maxlen</a> ) <a class="code" href="classbdm_1_1memlog.html#70cec1d3549a82796ad7b6f0d07a4570" title="Currect record to be written.">ind</a>++; |
| 90 | <a name="l00047"></a>00047 <span class="keywordflow">else</span> <a class="code" href="bdmerror_8h.html#7c43f3a72afe68ab0c85663a1bb3521a" title="Unconditionally throw std::runtime_error.">bdm_error</a> ( <span class="stringliteral">"memlog::ind is too high;"</span> ); |
96 | | <a name="l00050"></a><a class="code" href="classbdm_1_1memlog.html#a364e58c5d7058776c2a9cfa7d58dad6d">00050</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1memlog.html#a364e58c5d7058776c2a9cfa7d58dad6d" title="log this vector">logit</a> ( <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> vec &v ) { |
97 | | <a name="l00051"></a>00051 <a class="code" href="bdmerror_8h.html#a7a3399d182b8e3065532596e76f84849" title="Throw std::runtime_exception if t is not true.">bdm_assert</a> ( <span class="keywordtype">id</span> < <a class="code" href="classbdm_1_1memlog.html#a1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a>.length(), <span class="stringliteral">"Logger was not initialized, run init()."</span> ); |
| 93 | <a name="l00050"></a><a class="code" href="classbdm_1_1memlog.html#364e58c5d7058776c2a9cfa7d58dad6d">00050</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1memlog.html#364e58c5d7058776c2a9cfa7d58dad6d" title="log this vector">logit</a> ( <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> vec &v ) { |
| 94 | <a name="l00051"></a>00051 <a class="code" href="bdmerror_8h.html#7a3399d182b8e3065532596e76f84849" title="Throw std::runtime_exception if t is not true.">bdm_assert</a> ( <span class="keywordtype">id</span> < <a class="code" href="classbdm_1_1memlog.html#1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a>.length(), <span class="stringliteral">"Logger was not initialized, run init()."</span> ); |
102 | | <a name="l00056"></a><a class="code" href="classbdm_1_1memlog.html#a2b57dbd3dff49a98c6ce8fccccb170af">00056</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1memlog.html#a2b57dbd3dff49a98c6ce8fccccb170af" title="log this double">logit</a> ( <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> <span class="keywordtype">double</span> &d ) { |
103 | | <a name="l00057"></a>00057 <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> ( <span class="keywordtype">id</span> < <a class="code" href="classbdm_1_1memlog.html#a1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a>.length(), <span class="stringliteral">"Logger was not initialized, run init()."</span> ); |
104 | | <a name="l00058"></a>00058 <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> ( <a class="code" href="classbdm_1_1memlog.html#a1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a> ( <span class="keywordtype">id</span> ).cols() == 1, <span class="stringliteral">"Vector expected"</span> ); |
| 99 | <a name="l00056"></a><a class="code" href="classbdm_1_1memlog.html#2b57dbd3dff49a98c6ce8fccccb170af">00056</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1memlog.html#2b57dbd3dff49a98c6ce8fccccb170af" title="log this double">logit</a> ( <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> <span class="keywordtype">double</span> &d ) { |
| 100 | <a name="l00057"></a>00057 <a class="code" href="bdmerror_8h.html#89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> ( <span class="keywordtype">id</span> < <a class="code" href="classbdm_1_1memlog.html#1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a>.length(), <span class="stringliteral">"Logger was not initialized, run init()."</span> ); |
| 101 | <a name="l00058"></a>00058 <a class="code" href="bdmerror_8h.html#89a0f906b242b79c5d3d342291b2cab4" title="Throw std::runtime_exception if t is not true and NDEBUG is not defined.">bdm_assert_debug</a> ( <a class="code" href="classbdm_1_1memlog.html#1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a> ( <span class="keywordtype">id</span> ).cols() == 1, <span class="stringliteral">"Vector expected"</span> ); |
109 | | <a name="l00064"></a>00064 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1memlog.html#a6a74b7a3d889607391594279112aef1f" title="Save values into an itfile named after fname.">itsave</a> ( <span class="keyword">const</span> <span class="keywordtype">char</span>* fname ); |
110 | | <a name="l00066"></a><a class="code" href="classbdm_1_1memlog.html#a39e32f671414c71304e316976ccc37f3">00066</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1memlog.html#a39e32f671414c71304e316976ccc37f3" title="Finalize storing information.">finalize</a>() { |
111 | | <a name="l00067"></a>00067 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1memlog.html#a11fdf8ffca0f509ff637b0c3ac161c1f" title="name of it file to save results">itfilename</a>.length() > 0 ) <a class="code" href="classbdm_1_1memlog.html#a6a74b7a3d889607391594279112aef1f" title="Save values into an itfile named after fname.">itsave</a> ( <a class="code" href="classbdm_1_1memlog.html#a11fdf8ffca0f509ff637b0c3ac161c1f" title="name of it file to save results">itfilename</a>.c_str() ); |
| 106 | <a name="l00064"></a>00064 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1memlog.html#6a74b7a3d889607391594279112aef1f" title="Save values into an itfile named after fname.">itsave</a> ( <span class="keyword">const</span> <span class="keywordtype">char</span>* fname ); |
| 107 | <a name="l00066"></a><a class="code" href="classbdm_1_1memlog.html#39e32f671414c71304e316976ccc37f3">00066</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1memlog.html#39e32f671414c71304e316976ccc37f3" title="Finalize storing information.">finalize</a>() { |
| 108 | <a name="l00067"></a>00067 <span class="keywordflow">if</span> ( <a class="code" href="classbdm_1_1memlog.html#11fdf8ffca0f509ff637b0c3ac161c1f" title="name of it file to save results">itfilename</a>.length() > 0 ) <a class="code" href="classbdm_1_1memlog.html#6a74b7a3d889607391594279112aef1f" title="Save values into an itfile named after fname.">itsave</a> ( <a class="code" href="classbdm_1_1memlog.html#11fdf8ffca0f509ff637b0c3ac161c1f" title="name of it file to save results">itfilename</a>.c_str() ); |
128 | | <a name="l00100"></a><a class="code" href="classbdm_1_1stdlog.html#afbe8a8988ec1e66b0c3cf2cb776214a8">00100</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1stdlog.html#afbe8a8988ec1e66b0c3cf2cb776214a8" title="Initialize storage.">init</a>() { |
129 | | <a name="l00101"></a>00101 <a class="code" href="classbdm_1_1stdlog.html#afbe8a8988ec1e66b0c3cf2cb776214a8" title="Initialize storage.">memlog::init</a>(); |
130 | | <a name="l00102"></a>00102 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i<<a class="code" href="classbdm_1_1logger.html#ac54566a4554089443a20b2a49ed1a61f" title="RVs of all logged variables.">entries</a>.length();i++){ |
131 | | <a name="l00103"></a>00103 <span class="keywordflow">if</span> (<a class="code" href="classbdm_1_1logger.html#ac54566a4554089443a20b2a49ed1a61f" title="RVs of all logged variables.">entries</a>(i)._dsize()==1) { |
132 | | <a name="l00104"></a>00104 cout << <a class="code" href="classbdm_1_1logger.html#a68ca1f05cf3d414ba0f39211977b8d02" title="Names of logged quantities, e.g. names of algorithm variants.">names</a>(i) << <a class="code" href="classbdm_1_1logger.html#ac54566a4554089443a20b2a49ed1a61f" title="RVs of all logged variables.">entries</a>(i).name(0) << <span class="stringliteral">"\t"</span>; |
| 125 | <a name="l00100"></a><a class="code" href="classbdm_1_1stdlog.html#fbe8a8988ec1e66b0c3cf2cb776214a8">00100</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1stdlog.html#fbe8a8988ec1e66b0c3cf2cb776214a8" title="Initialize storage.">init</a>() { |
| 126 | <a name="l00101"></a>00101 <a class="code" href="classbdm_1_1stdlog.html#fbe8a8988ec1e66b0c3cf2cb776214a8" title="Initialize storage.">memlog::init</a>(); |
| 127 | <a name="l00102"></a>00102 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i<<a class="code" href="classbdm_1_1logger.html#c54566a4554089443a20b2a49ed1a61f" title="RVs of all logged variables.">entries</a>.length();i++){ |
| 128 | <a name="l00103"></a>00103 <span class="keywordflow">if</span> (<a class="code" href="classbdm_1_1logger.html#c54566a4554089443a20b2a49ed1a61f" title="RVs of all logged variables.">entries</a>(i)._dsize()==1) { |
| 129 | <a name="l00104"></a>00104 cout << <a class="code" href="classbdm_1_1logger.html#68ca1f05cf3d414ba0f39211977b8d02" title="Names of logged quantities, e.g. names of algorithm variants.">names</a>(i) << <a class="code" href="classbdm_1_1logger.html#c54566a4554089443a20b2a49ed1a61f" title="RVs of all logged variables.">entries</a>(i).name(0) << <span class="stringliteral">"\t"</span>; |
135 | | <a name="l00107"></a>00107 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j=0; j<<a class="code" href="classbdm_1_1memlog.html#a1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a>(i).cols(); j++){ |
136 | | <a name="l00108"></a>00108 cout << <a class="code" href="classbdm_1_1logger.html#a68ca1f05cf3d414ba0f39211977b8d02" title="Names of logged quantities, e.g. names of algorithm variants.">names</a>(i) << <a class="code" href="classbdm_1_1logger.html#ac54566a4554089443a20b2a49ed1a61f" title="RVs of all logged variables.">entries</a>(i).scalarname(j) << <span class="stringliteral">"\t"</span>; |
| 132 | <a name="l00107"></a>00107 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j=0; j<<a class="code" href="classbdm_1_1memlog.html#1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a>(i).cols(); j++){ |
| 133 | <a name="l00108"></a>00108 cout << <a class="code" href="classbdm_1_1logger.html#68ca1f05cf3d414ba0f39211977b8d02" title="Names of logged quantities, e.g. names of algorithm variants.">names</a>(i) << <a class="code" href="classbdm_1_1logger.html#c54566a4554089443a20b2a49ed1a61f" title="RVs of all logged variables.">entries</a>(i).scalarname(j) << <span class="stringliteral">"\t"</span>; |
143 | | <a name="l00116"></a><a class="code" href="classbdm_1_1stdlog.html#a57004e763add2e08dcdd8f5869db691d">00116</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1stdlog.html#a57004e763add2e08dcdd8f5869db691d" title="writes everything out">step</a>() { |
144 | | <a name="l00117"></a>00117 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i<<a class="code" href="classbdm_1_1memlog.html#a1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a>.length();i++){ |
145 | | <a name="l00118"></a>00118 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j=0; j<<a class="code" href="classbdm_1_1memlog.html#a1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a>(i).cols(); j++){ |
146 | | <a name="l00119"></a>00119 cout << <a class="code" href="classbdm_1_1memlog.html#a1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a>(i)(0,j) << <span class="stringliteral">"\t"</span>; |
| 140 | <a name="l00116"></a><a class="code" href="classbdm_1_1stdlog.html#57004e763add2e08dcdd8f5869db691d">00116</a> <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1stdlog.html#57004e763add2e08dcdd8f5869db691d" title="writes everything out">step</a>() { |
| 141 | <a name="l00117"></a>00117 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i<<a class="code" href="classbdm_1_1memlog.html#1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a>.length();i++){ |
| 142 | <a name="l00118"></a>00118 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j=0; j<<a class="code" href="classbdm_1_1memlog.html#1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a>(i).cols(); j++){ |
| 143 | <a name="l00119"></a>00119 cout << <a class="code" href="classbdm_1_1memlog.html#1fed143162f2de6ef1c1b6557964f24e" title="Storage.">vectors</a>(i)(0,j) << <span class="stringliteral">"\t"</span>; |
167 | | <a name="l00163"></a>00163 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1dirfilelog.html#a78a3bd8a83cbd6299e279544bc81493d" title="Initialize storage.">init</a>(); |
168 | | <a name="l00164"></a>00164 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1dirfilelog.html#af79660645d09aa2d8bdd18923a721662" title="Shifts storage position for another time step.">step</a>(); |
169 | | <a name="l00165"></a>00165 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1dirfilelog.html#a521d7ba159f97a0182392df27953804f" title="Finalize storing information.">finalize</a>(); |
170 | | <a name="l00169"></a>00169 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1dirfilelog.html#af595c0df25f5fa5d8c27ea1e375d9c51" title="Write memory storage to disk.">write_buffers</a> ( <span class="keywordtype">int</span> Len ); |
| 164 | <a name="l00163"></a>00163 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1dirfilelog.html#78a3bd8a83cbd6299e279544bc81493d" title="Initialize storage.">init</a>(); |
| 165 | <a name="l00164"></a>00164 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1dirfilelog.html#f79660645d09aa2d8bdd18923a721662" title="Shifts storage position for another time step.">step</a>(); |
| 166 | <a name="l00165"></a>00165 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1dirfilelog.html#521d7ba159f97a0182392df27953804f" title="Finalize storing information.">finalize</a>(); |
| 167 | <a name="l00169"></a>00169 <span class="keywordtype">void</span> <a class="code" href="classbdm_1_1dirfilelog.html#f595c0df25f5fa5d8c27ea1e375d9c51" title="Write memory storage to disk.">write_buffers</a> ( <span class="keywordtype">int</span> Len ); |