meta.h 849 Bytes
Newer Older
Guolin Ke's avatar
Guolin Ke committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef LIGHTGBM_META_H_
#define LIGHTGBM_META_H_

#include <cstdint>

#include <limits>
#include <vector>
#include <functional>

namespace LightGBM {

/*! \brief Type of data size, it is better to use signed type*/
typedef int32_t data_size_t;
/*! \brief Type of score, and gradients */
15
typedef float score_t;
Guolin Ke's avatar
Guolin Ke committed
16
17
18
19
20
21
22
23
24
25
26
27

const score_t kMinScore = -std::numeric_limits<score_t>::infinity();

const score_t kEpsilon = 1e-15f;

template<typename T>
std::vector<const T*> ConstPtrInVectorWarpper(std::vector<T*> input) {
  return std::vector<const T*>(input.begin(), input.end());
}

using ReduceFunction = std::function<void(const char*, char*, int)>;

Guolin Ke's avatar
Guolin Ke committed
28
29
30
31
32
33
using PredictFunction =
std::function<std::vector<double>(const std::vector<std::pair<int, double>>&)>;

#define NO_LIMIT (-1)
#define NO_SPECIFIC (-1)

Guolin Ke's avatar
Guolin Ke committed
34
35
}  // namespace LightGBM

Guolin Ke's avatar
Guolin Ke committed
36
#endif   // LightGBM_META_H_