Commit fd0cbe65 authored by Guolin Ke's avatar Guolin Ke
Browse files

slight improve prediction speed

parent 4948dcc5
...@@ -138,8 +138,8 @@ public: ...@@ -138,8 +138,8 @@ public:
} }
} }
static std::vector<std::function<bool(unsigned int, unsigned int)>> inner_decision_funs; static std::vector<bool(*)(unsigned int, unsigned int)> inner_decision_funs;
static std::vector<std::function<bool(double, double)>> decision_funs; static std::vector<bool(*)(double, double)> decision_funs;
private: private:
/*! /*!
......
...@@ -16,12 +16,11 @@ ...@@ -16,12 +16,11 @@
namespace LightGBM { namespace LightGBM {
std::vector<std::function<bool(unsigned int, unsigned int)>> Tree::inner_decision_funs = std::vector<bool(*)(unsigned int, unsigned int)> Tree::inner_decision_funs =
{Tree::NumericalDecision<unsigned int>, Tree::CategoricalDecision<unsigned int> }; {Tree::NumericalDecision<unsigned int>, Tree::CategoricalDecision<unsigned int> };
std::vector<std::function<bool(double, double)>> Tree::decision_funs = std::vector<bool(*)(double, double)> Tree::decision_funs =
{ Tree::NumericalDecision<double>, Tree::CategoricalDecision<double> }; { Tree::NumericalDecision<double>, Tree::CategoricalDecision<double> };
Tree::Tree(int max_leaves) Tree::Tree(int max_leaves)
:max_leaves_(max_leaves) { :max_leaves_(max_leaves) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment