Medial Code Documentation
Loading...
Searching...
No Matches
Namespaces | Macros | Functions | Variables
utils.h File Reference

simple utils to support the code More...

#include <rabit/base.h>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <stdexcept>
#include <string>
#include <vector>
#include "dmlc/io.h"
#include "xgboost/logging.h"
#include <sys/types.h>
#include <cinttypes>

Go to the source code of this file.

Namespaces

namespace  rabit
 namespace of rabit
 
namespace  rabit::utils
 namespace for helper utils of the project
 

Macros

#define fopen64   std::fopen
 

Functions

int rabit::utils::CompareStringsCaseInsensitive (const char *s1, const char *s2)
 
bool rabit::utils::StringToBool (const char *s)
 
void rabit::utils::Printf (const char *fmt,...)
 printf, prints messages to the console
 
void rabit::utils::Assert (bool exp, const char *fmt,...)
 assert a condition is true, use this to handle debug information
 
void rabit::utils::Check (bool exp, const char *fmt,...)
 same as assert, but this is intended to be used as a message for users
 
void rabit::utils::Error (const char *fmt,...)
 report error message, same as check
 
template<typename T >
auto rabit::Min (T const &l, T const &r)
 
template<typename T >
auto rabit::Max (T const &l, T const &r)
 
template<typename T >
T * rabit::BeginPtr (std::vector< T > &vec)
 get the beginning address of a vector
 
char * rabit::BeginPtr (std::string &str)
 
const char * rabit::BeginPtr (const std::string &str)
 

Variables

const int rabit::utils::kPrintBuffer = 1 << 12
 error message buffer length
 

Detailed Description

simple utils to support the code

Copyright (c) 2014 by Contributors

Author
Tianqi Chen