From 62d5373e5f6035c5d24e8c67ad676feb5f0940ae Mon Sep 17 00:00:00 2001 From: StrikerRUS Date: Sat, 4 Apr 2020 17:29:22 +0300 Subject: [PATCH] fixed cpplint errors --- include/LightGBM/utils/openmp_wrapper.h | 3 ++- src/io/tree.cpp | 4 ++-- src/lightgbm_R.cpp | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/LightGBM/utils/openmp_wrapper.h b/include/LightGBM/utils/openmp_wrapper.h index aab5cea2905c..075c991371c0 100644 --- a/include/LightGBM/utils/openmp_wrapper.h +++ b/include/LightGBM/utils/openmp_wrapper.h @@ -6,9 +6,10 @@ #define LIGHTGBM_OPENMP_WRAPPER_H_ #ifdef _OPENMP -#include #include +#include + #include #include #include diff --git a/src/io/tree.cpp b/src/io/tree.cpp index 4c8fb4eb0e20..52145acad196 100644 --- a/src/io/tree.cpp +++ b/src/io/tree.cpp @@ -71,7 +71,7 @@ int Tree::SplitCategorical(int leaf, int feature, int real_feature, const uint32 int new_node_idx = num_leaves_ - 1; decision_type_[new_node_idx] = 0; SetDecisionType(&decision_type_[new_node_idx], true, kCategoricalMask); - SetMissingType(&decision_type_[new_node_idx], missing_type); + SetMissingType(&decision_type_[new_node_idx], missing_type); threshold_in_bin_[new_node_idx] = num_cat_; threshold_[new_node_idx] = num_cat_; ++num_cat_; @@ -335,7 +335,7 @@ std::string Tree::NumericalDecisionIfElse(int node) const { std::stringstream str_buf; uint8_t missing_type = GetMissingType(decision_type_[node]); bool default_left = GetDecisionType(decision_type_[node], kDefaultLeftMask); - if (missing_type == MissingType::None + if (missing_type == MissingType::None || (missing_type == MissingType::Zero && default_left && kZeroThreshold < threshold_[node])) { str_buf << "if (fval <= " << threshold_[node] << ") {"; } else if (missing_type == MissingType::Zero) { diff --git a/src/lightgbm_R.cpp b/src/lightgbm_R.cpp index 7d3a8dcafe80..653d3cc5d0ed 100644 --- a/src/lightgbm_R.cpp +++ b/src/lightgbm_R.cpp @@ -9,6 +9,8 @@ #include #include +#include + #include #include #include @@ -16,8 +18,6 @@ #include #include -#include - #define COL_MAJOR (0) #define R_API_BEGIN() \