cleanup of evaluation metric, move c++11 codes into sample.h for backup, add lambda in a clean way latter

This commit is contained in:
tqchen
2014-05-01 11:00:50 -07:00
parent f17d400fd3
commit ef7df40bc8
4 changed files with 279 additions and 329 deletions

View File

@@ -129,17 +129,15 @@ namespace xgboost{
};
namespace random{
/*! \brief random number generator with independent random number seed*/
struct Random{
/*! \brief set random number seed */
inline void Seed( unsigned sd ){
this->rseed = sd;
}
/*! \brief return a real number uniform in [0,1) */
inline double RandDouble( void ){
// return static_cast<double>( rand_( &rseed ) ) / (static_cast<double>( RAND_MAX )+1.0);
return static_cast<double>(rand()) / (static_cast<double>(RAND_MAX)+1.0);
inline double RandDouble( void ){
return static_cast<double>( rand_r( &rseed ) ) / (static_cast<double>( RAND_MAX )+1.0);
}
// random number seed
unsigned rseed;