Files Classes Functions Hierarchy
#include <funcstate.h>
Public Member Functions | |
| funchistory (funcstate< X > &fs_) | |
| Initialize reference. | |
| ~funchistory () | |
| Free memory if allocated. | |
| X * | operator[] (uintc i) |
| Access position states. | |
| void | push () |
| Save current position. | |
| void | pop () |
| Read then delete front of xik stack into the current position. | |
| void | restore () |
| Copy the front of xik stack to the current position. | |
| void | del_back () |
| Removes the last position stack element. | |
Public Attributes | |
| deque< X * > | xik |
| Previous positions with function value as the last element. | |
| funcstate< X > & | fs |
| The function. | |
Definition at line 61 of file funcstate.h.
| funchistory< X >::funchistory | ( | funcstate< X > & | fs_ | ) | [inline] |
| funchistory< X >::~funchistory | ( | ) | [inline] |
Free memory if allocated.
Definition at line 181 of file funcstate.h.
References funchistory< X >::xik.
| void funchistory< X >::del_back | ( | ) | [inline] |
Removes the last position stack element.
Definition at line 170 of file funcstate.h.
References funchistory< X >::xik.
00171 { 00172 if (xik.empty()) 00173 return; 00174 00175 X * z = xik.back(); 00176 xik.pop_back(); 00177 delete[] z; 00178 }
| X* funchistory< X >::operator[] | ( | uintc | i | ) | [inline] |
Access position states.
Definition at line 78 of file funcstate.h.
References funchistory< X >::xik.
| void funchistory< X >::pop | ( | ) | [inline] |
Read then delete front of xik stack into the current position.
Definition at line 146 of file funcstate.h.
References funchistory< X >::fs, and funchistory< X >::xik.
Referenced by functest::test08().
00147 { 00148 assert( xik.empty()==false); 00149 if (xik.empty()) 00150 return; 00151 00152 X * z = xik[0]; 00153 fs.set_positionvalue( z ); 00154 delete[] z; 00155 xik.pop_front(); 00156 }
| void funchistory< X >::push | ( | ) | [inline] |
Save current position.
Definition at line 136 of file funcstate.h.
References funchistory< X >::fs, and funchistory< X >::xik.
Referenced by functest::test08().
00137 { 00138 X* x= new X[fs.dim+1]; 00139 for (uint i=0; i<=fs.dim; ++i) 00140 x[i] = fs.xi[i]; 00141 00142 xik.push_front(x); 00143 }
| void funchistory< X >::restore | ( | ) | [inline] |
Copy the front of xik stack to the current position.
Definition at line 159 of file funcstate.h.
References funchistory< X >::fs, and funchistory< X >::xik.
00160 { 00161 assert( xik.empty()==false); 00162 if (xik.empty()) 00163 return; 00164 00165 X * z = xik[0]; 00166 fs.set_positionvalue( z ); 00167 }
| funcstate<X>& funchistory< X >::fs |
The function.
Definition at line 69 of file funcstate.h.
Referenced by funchistory< X >::pop(), funchistory< X >::push(), and funchistory< X >::restore().
| deque< X* > funchistory< X >::xik |
Previous positions with function value as the last element.
Definition at line 66 of file funcstate.h.
Referenced by funchistory< X >::del_back(), funchistory< X >::operator[](), funchistory< X >::pop(), funchistory< X >::push(), funchistory< X >::restore(), and funchistory< X >::~funchistory().
1.5.8