Changeset 604 for library/bdm/base/bdmbase.h
- Timestamp:
- 09/06/09 22:53:06 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/bdmbase.h
r603 r604 149 149 friend std::ostream &operator<< ( std::ostream &os, const RV &rv ); 150 150 151 string to_string() {ostringstream o; o << this; return o.str();} 152 153 //! total size of a random variable 151 154 int _dsize() const { 152 155 return dsize; … … 160 163 //! Recount size of the corresponding data vector 161 164 int countsize() const; 165 //! Vector of cumulative sizes of RV 162 166 ivec cumsizes() const; 167 //! Number of named parts 163 168 int length() const { 164 169 return len; … … 206 211 207 212 //! Shift \c time by delta. 208 void t ( int delta );209 //!@} 210 211 //! @{ \name Auxiliaryfunctions213 void t_plus ( int delta ); 214 //!@} 215 216 //! @{ \name Time manipulation functions 212 217 //! returns rvs with time set to 0 and removed duplicates 213 218 RV remove_time() const { 214 219 return RV ( unique ( ids ), dummy ); 220 } 221 //! create new RV from the current one with time shifted by given value 222 RV copy_t(int dt) const { 223 RV tmp=*this; 224 tmp.t_plus(dt); 225 return tmp; 215 226 } 216 227 //! return rvs with expanded delayes and sorted in the order of: \f$ [ rv_{0}, rv_{-1}, rv_{ … … 220 231 int td = mint(); 221 232 for ( int i = -1; i >= td; i-- ) { 222 rvt.t ( -1 );233 rvt.t_plus ( -1 ); 223 234 tmp.add ( rvt ); //shift u1 224 235 } … … 266 277 //! Invalidate all named RVs. Use before initializing any RV instances, with care... 267 278 static void clear_all(); 279 //! function for debugging RV related stuff 280 string show_all(); 281 268 282 }; 269 283 UIREGISTER ( RV ); … … 497 511 return ep->_rv(); 498 512 } 499 const RV& _rvc() {513 const RV& _rvc() const { 500 514 return rvc; 501 515 }