Show
Ignore:
Timestamp:
06/09/10 14:00:40 (14 years ago)
Author:
mido
Message:

astyle applied all over the library

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/itpp_ext.h

    r737 r1064  
    4242template<class Num_T> inline 
    4343void set_col_part ( mat &M, int c, const Vec<Num_T> &v ) { 
    44         copy_vector ( v.size(), v._data(), M._data() + c*M.rows() ); 
     44    copy_vector ( v.size(), v._data(), M._data() + c*M.rows() ); 
    4545} 
    4646 
     
    5555public: 
    5656//! constructor. Set lambda. 
    57         Gamma_RNG ( double a = 1.0, double b = 1.0 ); 
    58         //! Set lambda 
    59         void setup ( double a0, double b0 ) { 
    60                 alpha = a0; 
    61                 beta = b0; 
    62         } 
    63         //! get lambda 
    64         double get_setup() const; 
    65         //! Get one sample. 
    66         double operator() () { 
    67                 return sample(); 
    68         } 
    69         //! Get a sample vector. 
    70         vec operator() ( int n ); 
    71         //! Get a sample matrix. 
    72         mat operator() ( int h, int w ); 
     57    Gamma_RNG ( double a = 1.0, double b = 1.0 ); 
     58    //! Set lambda 
     59    void setup ( double a0, double b0 ) { 
     60        alpha = a0; 
     61        beta = b0; 
     62    } 
     63    //! get lambda 
     64    double get_setup() const; 
     65    //! Get one sample. 
     66    double operator() () { 
     67        return sample(); 
     68    } 
     69    //! Get a sample vector. 
     70    vec operator() ( int n ); 
     71    //! Get a sample matrix. 
     72    mat operator() ( int h, int w ); 
    7373protected: 
    7474private: 
    75         //! 
    76         double sample(); 
    77         //! 
    78         double alpha; 
    79         //! 
    80         double beta; 
    81         //! 
    82         Random_Generator RNG; 
    83         Normal_RNG NRNG; 
    84         //! compatibility with R 
    85         inline double exp_rand() { 
    86                 return -std::log ( RNG.random_01() ); 
    87         } 
    88         inline double unif_rand() { 
    89                 return RNG.random_01(); 
    90         } 
    91         inline double norm_rand() { 
    92                 return NRNG.sample(); 
    93         } 
     75    //! 
     76    double sample(); 
     77    //! 
     78    double alpha; 
     79    //! 
     80    double beta; 
     81    //! 
     82    Random_Generator RNG; 
     83    Normal_RNG NRNG; 
     84    //! compatibility with R 
     85    inline double exp_rand() { 
     86        return -std::log ( RNG.random_01() ); 
     87    } 
     88    inline double unif_rand() { 
     89        return RNG.random_01(); 
     90    } 
     91    inline double norm_rand() { 
     92        return NRNG.sample(); 
     93    } 
    9494 
    9595};