Ignore:
Timestamp:
Nov 5, 2008, 9:08:55 PM (13 years ago)
Author:
Peter
Message:

implementing copying in RNG_state. Previously compiler generated versions were used which was not sound. Also disallowed assignment of singleton RNG. Assignment of a singleton class does not make sense.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/random/random.h

    r1487 r1614  
    154154    RNG(const RNG&);
    155155
     156    /**
     157       There can be only one RNG so assignment is always
     158       self-assignment and we do not allow it
     159    */
     160    RNG& operator=(const RNG&);
     161
    156162    virtual ~RNG(void);
    157163
     
    172178    RNG_state(const RNG*);
    173179
     180    /**
     181       Copy Constructor
     182
     183       \since Explicitely declared since yat 0.5
     184     */
     185    RNG_state(const RNG_state&);
     186
    174187    ///
    175188    /// @brief Destructor
     
    182195    const gsl_rng* rng(void) const;
    183196
     197    /**
     198       Assignment operator
     199
     200       \since Explicitely declared since yat 0.5
     201     */
     202    RNG_state& operator=(const RNG_state&);
     203
    184204  private:
    185205    gsl_rng* rng_;
    186206
     207    void clone(const gsl_rng&);
    187208  };
    188209   
Note: See TracChangeset for help on using the changeset viewer.