Show
Ignore:
Timestamp:
09/06/09 22:53:06 (15 years ago)
Author:
smidl
Message:

change of syntax of RV

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/base/bdmbase.h

    r603 r604  
    149149        friend std::ostream &operator<< ( std::ostream &os, const RV &rv ); 
    150150 
     151        string to_string() {ostringstream o; o << this; return o.str();} 
     152         
     153        //! total size of a random variable 
    151154        int _dsize() const { 
    152155                return dsize; 
     
    160163        //! Recount size of the corresponding data vector 
    161164        int countsize() const; 
     165        //! Vector of cumulative sizes of RV 
    162166        ivec cumsizes() const; 
     167        //! Number of named parts 
    163168        int length() const { 
    164169                return len; 
     
    206211 
    207212        //! Shift \c time by delta. 
    208         void t ( int delta ); 
    209         //!@} 
    210  
    211         //! @{ \name Auxiliary functions 
     213        void t_plus ( int delta ); 
     214        //!@} 
     215 
     216        //! @{ \name Time manipulation functions 
    212217        //! returns rvs with time set to 0 and removed duplicates 
    213218        RV remove_time() const { 
    214219                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; 
    215226        } 
    216227        //! return rvs with expanded delayes and sorted in the order of: \f$ [ rv_{0}, rv_{-1}, rv_{ 
     
    220231                int td = mint(); 
    221232                for ( int i = -1; i >= td; i-- ) { 
    222                         rvt.t ( -1 ); 
     233                        rvt.t_plus ( -1 ); 
    223234                        tmp.add ( rvt ); //shift u1 
    224235                } 
     
    266277        //! Invalidate all named RVs. Use before initializing any RV instances, with care... 
    267278        static void clear_all(); 
     279        //! function for debugging RV related stuff 
     280        string show_all(); 
     281 
    268282}; 
    269283UIREGISTER ( RV ); 
     
    497511                return ep->_rv(); 
    498512        } 
    499         const RV& _rvc() { 
     513        const RV& _rvc() const { 
    500514                return rvc; 
    501515        }