Skip to content

Commit

Permalink
re-order includes (fixes microsoft#3132) (microsoft#3133)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored and ChipKerchner committed Jun 10, 2020
1 parent 7ab45f0 commit 3d7fa7a
Show file tree
Hide file tree
Showing 77 changed files with 292 additions and 275 deletions.
14 changes: 7 additions & 7 deletions R-package/src/lightgbm_R.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@

#include "lightgbm_R.h"

#include <LightGBM/utils/common.h>
#include <LightGBM/utils/log.h>
#include <LightGBM/utils/openmp_wrapper.h>
#include <LightGBM/utils/text_reader.h>

#include <R_ext/Rdynload.h>

#include <string>
#include <cstdio>
#include <cstring>
#include <memory>
#include <utility>
#include <vector>

#include <LightGBM/utils/common.h>
#include <LightGBM/utils/log.h>
#include <LightGBM/utils/openmp_wrapper.h>
#include <LightGBM/utils/text_reader.h>

#include <R_ext/Rdynload.h>

#define COL_MAJOR (0)

#define R_API_BEGIN() \
Expand Down
6 changes: 3 additions & 3 deletions include/LightGBM/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
#ifndef LIGHTGBM_APPLICATION_H_
#define LIGHTGBM_APPLICATION_H_

#include <LightGBM/config.h>
#include <LightGBM/meta.h>

#include <memory>
#include <vector>

#include <LightGBM/config.h>
#include <LightGBM/meta.h>

namespace LightGBM {

class DatasetLoader;
Expand Down
8 changes: 4 additions & 4 deletions include/LightGBM/bin.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
#ifndef LIGHTGBM_BIN_H_
#define LIGHTGBM_BIN_H_

#include <LightGBM/meta.h>
#include <LightGBM/utils/common.h>
#include <LightGBM/utils/file_io.h>

#include <limits>
#include <string>
#include <functional>
#include <sstream>
#include <unordered_map>
#include <vector>

#include <LightGBM/meta.h>
#include <LightGBM/utils/common.h>
#include <LightGBM/utils/file_io.h>

namespace LightGBM {

enum BinType {
Expand Down
6 changes: 3 additions & 3 deletions include/LightGBM/boosting.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
#ifndef LIGHTGBM_BOOSTING_H_
#define LIGHTGBM_BOOSTING_H_

#include <LightGBM/config.h>
#include <LightGBM/meta.h>

#include <string>
#include <map>
#include <unordered_map>
#include <vector>

#include <LightGBM/config.h>
#include <LightGBM/meta.h>

namespace LightGBM {

/*! \brief forward declaration */
Expand Down
4 changes: 2 additions & 2 deletions include/LightGBM/c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
#ifndef LIGHTGBM_C_API_H_
#define LIGHTGBM_C_API_H_

#include <LightGBM/export.h>

#include <cstdint>
#include <cstdio>
#include <cstring>

#include <LightGBM/export.h>


typedef void* DatasetHandle; /*!< \brief Handle of dataset. */
typedef void* BoosterHandle; /*!< \brief Handle of booster. */
Expand Down
10 changes: 5 additions & 5 deletions include/LightGBM/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
#ifndef LIGHTGBM_CONFIG_H_
#define LIGHTGBM_CONFIG_H_

#include <LightGBM/export.h>
#include <LightGBM/meta.h>
#include <LightGBM/utils/common.h>
#include <LightGBM/utils/log.h>

#include <string>
#include <algorithm>
#include <memory>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#include <LightGBM/export.h>
#include <LightGBM/meta.h>
#include <LightGBM/utils/common.h>
#include <LightGBM/utils/log.h>

namespace LightGBM {

/*! \brief Types of tasks */
Expand Down
14 changes: 7 additions & 7 deletions include/LightGBM/dataset.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
#ifndef LIGHTGBM_DATASET_H_
#define LIGHTGBM_DATASET_H_

#include <LightGBM/config.h>
#include <LightGBM/feature_group.h>
#include <LightGBM/meta.h>
#include <LightGBM/utils/openmp_wrapper.h>
#include <LightGBM/utils/random.h>
#include <LightGBM/utils/text_reader.h>

#include <string>
#include <functional>
#include <memory>
Expand All @@ -20,6 +13,13 @@
#include <utility>
#include <vector>

#include <LightGBM/config.h>
#include <LightGBM/feature_group.h>
#include <LightGBM/meta.h>
#include <LightGBM/utils/openmp_wrapper.h>
#include <LightGBM/utils/random.h>
#include <LightGBM/utils/text_reader.h>

namespace LightGBM {

/*! \brief forward declaration */
Expand Down
4 changes: 2 additions & 2 deletions include/LightGBM/dataset_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
#ifndef LIGHTGBM_DATASET_LOADER_H_
#define LIGHTGBM_DATASET_LOADER_H_

#include <LightGBM/dataset.h>

#include <string>
#include <unordered_set>
#include <vector>

#include <LightGBM/dataset.h>

namespace LightGBM {

class DatasetLoader {
Expand Down
8 changes: 4 additions & 4 deletions include/LightGBM/feature_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
#ifndef LIGHTGBM_FEATURE_GROUP_H_
#define LIGHTGBM_FEATURE_GROUP_H_

#include <LightGBM/bin.h>
#include <LightGBM/meta.h>
#include <LightGBM/utils/random.h>

#include <cstdio>
#include <memory>
#include <vector>

#include <LightGBM/bin.h>
#include <LightGBM/meta.h>
#include <LightGBM/utils/random.h>

namespace LightGBM {

class Dataset;
Expand Down
6 changes: 3 additions & 3 deletions include/LightGBM/metric.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
#ifndef LIGHTGBM_METRIC_H_
#define LIGHTGBM_METRIC_H_

#include <string>
#include <vector>

#include <LightGBM/config.h>
#include <LightGBM/dataset.h>
#include <LightGBM/meta.h>
#include <LightGBM/objective_function.h>
#include <LightGBM/utils/log.h>
#include <LightGBM/utils/common.h>

#include <string>
#include <vector>

namespace LightGBM {

/*!
Expand Down
8 changes: 4 additions & 4 deletions include/LightGBM/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
#ifndef LIGHTGBM_NETWORK_H_
#define LIGHTGBM_NETWORK_H_

#include <LightGBM/config.h>
#include <LightGBM/meta.h>
#include <LightGBM/utils/log.h>

#include <functional>
#include <memory>
#include <vector>

#include <LightGBM/config.h>
#include <LightGBM/meta.h>
#include <LightGBM/utils/log.h>

namespace LightGBM {

/*! \brief forward declaration */
Expand Down
6 changes: 3 additions & 3 deletions include/LightGBM/objective_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#ifndef LIGHTGBM_OBJECTIVE_FUNCTION_H_
#define LIGHTGBM_OBJECTIVE_FUNCTION_H_

#include <string>
#include <functional>

#include <LightGBM/config.h>
#include <LightGBM/dataset.h>
#include <LightGBM/meta.h>

#include <string>
#include <functional>

namespace LightGBM {
/*!
* \brief The interface of Objective Function.
Expand Down
4 changes: 2 additions & 2 deletions include/LightGBM/prediction_early_stop.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#ifndef LIGHTGBM_PREDICTION_EARLY_STOP_H_
#define LIGHTGBM_PREDICTION_EARLY_STOP_H_

#include <LightGBM/export.h>

#include <string>
#include <functional>

#include <LightGBM/export.h>

namespace LightGBM {

struct PredictionEarlyStopInstance {
Expand Down
6 changes: 3 additions & 3 deletions include/LightGBM/tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
#ifndef LIGHTGBM_TREE_H_
#define LIGHTGBM_TREE_H_

#include <LightGBM/dataset.h>
#include <LightGBM/meta.h>

#include <string>
#include <map>
#include <memory>
#include <unordered_map>
#include <vector>

#include <LightGBM/dataset.h>
#include <LightGBM/meta.h>

namespace LightGBM {

#define kCategoricalMask (1)
Expand Down
6 changes: 3 additions & 3 deletions include/LightGBM/tree_learner.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#ifndef LIGHTGBM_TREE_LEARNER_H_
#define LIGHTGBM_TREE_LEARNER_H_

#include <string>
#include <vector>

#include <LightGBM/config.h>
#include <LightGBM/meta.h>
#include <LightGBM/utils/json11.h>

#include <string>
#include <vector>

namespace LightGBM {

using json11::Json;
Expand Down
6 changes: 3 additions & 3 deletions include/LightGBM/utils/array_args.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#ifndef LIGHTGBM_UTILS_ARRAY_AGRS_H_
#define LIGHTGBM_UTILS_ARRAY_AGRS_H_

#include <LightGBM/utils/openmp_wrapper.h>
#include <LightGBM/utils/threading.h>

#include <algorithm>
#include <utility>
#include <vector>

#include <LightGBM/utils/openmp_wrapper.h>
#include <LightGBM/utils/threading.h>

namespace LightGBM {

/*!
Expand Down
6 changes: 3 additions & 3 deletions include/LightGBM/utils/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
#ifndef LIGHTGBM_UTILS_COMMON_FUN_H_
#define LIGHTGBM_UTILS_COMMON_FUN_H_

#include <LightGBM/utils/log.h>
#include <LightGBM/utils/openmp_wrapper.h>

#include <limits>
#include <string>
#include <algorithm>
Expand All @@ -26,6 +23,9 @@
#include <utility>
#include <vector>

#include <LightGBM/utils/log.h>
#include <LightGBM/utils/openmp_wrapper.h>

#if defined(_MSC_VER)
#include <malloc.h>
#elif MM_MALLOC
Expand Down
8 changes: 4 additions & 4 deletions include/LightGBM/utils/openmp_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
#define LIGHTGBM_OPENMP_WRAPPER_H_
#ifdef _OPENMP

#include <LightGBM/utils/log.h>

#include <omp.h>

#include <exception>
#include <memory>
#include <mutex>
#include <stdexcept>
#include <vector>

#include <omp.h>

#include <LightGBM/utils/log.h>

inline int OMP_NUM_THREADS() {
int ret = 1;
#pragma omp parallel
Expand Down
6 changes: 3 additions & 3 deletions include/LightGBM/utils/pipeline_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
#ifndef LIGHTGBM_UTILS_PIPELINE_READER_H_
#define LIGHTGBM_UTILS_PIPELINE_READER_H_

#include <LightGBM/utils/file_io.h>
#include <LightGBM/utils/log.h>

#include <algorithm>
#include <cstdio>
#include <functional>
Expand All @@ -16,6 +13,9 @@
#include <utility>
#include <vector>

#include <LightGBM/utils/file_io.h>
#include <LightGBM/utils/log.h>

namespace LightGBM {

/*!
Expand Down
8 changes: 4 additions & 4 deletions include/LightGBM/utils/text_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
#ifndef LIGHTGBM_UTILS_TEXT_READER_H_
#define LIGHTGBM_UTILS_TEXT_READER_H_

#include <LightGBM/utils/log.h>
#include <LightGBM/utils/pipeline_reader.h>
#include <LightGBM/utils/random.h>

#include <string>
#include <cstdio>
#include <functional>
#include <sstream>
#include <vector>

#include <LightGBM/utils/log.h>
#include <LightGBM/utils/pipeline_reader.h>
#include <LightGBM/utils/random.h>

namespace LightGBM {

const size_t kGbs = size_t(1024) * 1024 * 1024;
Expand Down
Loading

0 comments on commit 3d7fa7a

Please sign in to comment.