rank pass toy

This commit is contained in:
kalenhaha
2014-04-07 23:25:35 +08:00
parent 40c380e40a
commit a10f594644
32 changed files with 2237 additions and 2146 deletions

View File

@@ -36,39 +36,39 @@ extern "C"{
namespace xgboost{
/*! \brief namespace for helper utils of the project */
namespace utils{
inline void Error( const char *msg ){
fprintf( stderr, "Error:%s\n",msg );
exit( -1 );
}
inline void Assert( bool exp ){
if( !exp ) Error( "AssertError" );
}
inline void Assert( bool exp, const char *msg ){
if( !exp ) Error( msg );
inline void Error(const char *msg){
fprintf(stderr, "Error:%s\n", msg);
exit(-1);
}
inline void Warning( const char *msg ){
fprintf( stderr, "warning:%s\n",msg );
inline void Assert(bool exp){
if (!exp) Error("AssertError");
}
inline void Assert(bool exp, const char *msg){
if (!exp) Error(msg);
}
inline void Warning(const char *msg){
fprintf(stderr, "warning:%s\n", msg);
}
/*! \brief replace fopen, report error when the file open fails */
inline FILE *FopenCheck( const char *fname , const char *flag ){
FILE *fp = fopen64( fname , flag );
if( fp == NULL ){
fprintf( stderr, "can not open file \"%s\"\n",fname );
exit( -1 );
inline FILE *FopenCheck(const char *fname, const char *flag){
FILE *fp = fopen64(fname, flag);
if (fp == NULL){
fprintf(stderr, "can not open file \"%s\"\n", fname);
exit(-1);
}
return fp;
}
/*! \brief replace fopen, */
inline FILE *FopenTry( const char *fname , const char *flag ){
FILE *fp = fopen64( fname , flag );
if( fp == NULL ){
fprintf( stderr, "can not open file \"%s\"\n",fname );
exit( -1 );
inline FILE *FopenTry(const char *fname, const char *flag){
FILE *fp = fopen64(fname, flag);
if (fp == NULL){
fprintf(stderr, "can not open file \"%s\"\n", fname);
exit(-1);
}
return fp;
}