Skip to content

Commit

Permalink
Reorder includes. (#5749)
Browse files Browse the repository at this point in the history
* Reorder includes.

* R.
  • Loading branch information
trivialfis authored Jun 3, 2020
1 parent cd3d14a commit d3a0efb
Show file tree
Hide file tree
Showing 89 changed files with 293 additions and 263 deletions.
15 changes: 9 additions & 6 deletions R-package/src/xgboost_R.cc
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
// Copyright (c) 2014 by Contributors
#include <dmlc/logging.h>
#include <dmlc/omp.h>
#include <xgboost/c_api.h>
#include <cstring>
#include <cstdio>
#include <vector>
#include <string>
#include <utility>
#include <cstring>
#include <cstdio>
#include <sstream>
#include "./xgboost_R.h"

#include <dmlc/logging.h>
#include <dmlc/omp.h>
#include <xgboost/c_api.h>

#include "xgboost_R.h"


/*!
* \brief macro to annotate begin of api
Expand Down
5 changes: 3 additions & 2 deletions include/xgboost/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
#ifndef XGBOOST_BASE_H_
#define XGBOOST_BASE_H_

#include <dmlc/base.h>
#include <dmlc/omp.h>
#include <cmath>
#include <iostream>
#include <vector>
#include <string>
#include <utility>

#include <dmlc/base.h>
#include <dmlc/omp.h>

/*!
* \brief string flag for R library, to leave hooks when needed.
*/
Expand Down
14 changes: 7 additions & 7 deletions include/xgboost/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
#ifndef XGBOOST_DATA_H_
#define XGBOOST_DATA_H_

#include <memory>
#include <numeric>
#include <algorithm>
#include <string>
#include <utility>
#include <vector>

#include <dmlc/base.h>
#include <dmlc/data.h>
#include <dmlc/serializer.h>
Expand All @@ -15,13 +22,6 @@
#include <xgboost/span.h>
#include <xgboost/host_device_vector.h>

#include <memory>
#include <numeric>
#include <algorithm>
#include <string>
#include <utility>
#include <vector>

namespace xgboost {
// forward declare dmatrix.
class DMatrix;
Expand Down
4 changes: 2 additions & 2 deletions include/xgboost/feature_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
#ifndef XGBOOST_FEATURE_MAP_H_
#define XGBOOST_FEATURE_MAP_H_

#include <xgboost/logging.h>

#include <vector>
#include <string>
#include <cstring>
#include <iostream>

#include <xgboost/logging.h>

namespace xgboost {
/*!
* \brief Feature map data structure to help text model dump.
Expand Down
14 changes: 7 additions & 7 deletions include/xgboost/gbm.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
#ifndef XGBOOST_GBM_H_
#define XGBOOST_GBM_H_

#include <dmlc/registry.h>
#include <dmlc/any.h>
#include <xgboost/base.h>
#include <xgboost/data.h>
#include <xgboost/host_device_vector.h>
#include <xgboost/model.h>

#include <vector>
#include <utility>
#include <string>
#include <functional>
#include <unordered_map>
#include <memory>

#include <dmlc/registry.h>
#include <dmlc/any.h>
#include <xgboost/base.h>
#include <xgboost/data.h>
#include <xgboost/host_device_vector.h>
#include <xgboost/model.h>

namespace xgboost {

class Json;
Expand Down
4 changes: 2 additions & 2 deletions include/xgboost/generic_parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#ifndef XGBOOST_GENERIC_PARAMETERS_H_
#define XGBOOST_GENERIC_PARAMETERS_H_

#include <string>

#include <xgboost/logging.h>
#include <xgboost/parameter.h>

#include <string>

namespace xgboost {
struct GenericParameter : public XGBoostParameter<GenericParameter> {
// Constant representing the device ID of CPU.
Expand Down
8 changes: 4 additions & 4 deletions include/xgboost/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
#ifndef XGBOOST_JSON_H_
#define XGBOOST_JSON_H_

#include <xgboost/logging.h>
#include <xgboost/parameter.h>
#include <string>

#include <map>
#include <memory>
#include <vector>
#include <functional>
#include <utility>
#include <string>

#include <xgboost/logging.h>
#include <xgboost/parameter.h>

namespace xgboost {

Expand Down
3 changes: 2 additions & 1 deletion include/xgboost/json_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
#ifndef XGBOOST_JSON_IO_H_
#define XGBOOST_JSON_IO_H_
#include <xgboost/json.h>

#include <memory>
#include <string>
Expand All @@ -14,6 +13,8 @@
#include <sstream>
#include <locale>

#include <xgboost/json.h>

namespace xgboost {

template <typename Allocator>
Expand Down
12 changes: 6 additions & 6 deletions include/xgboost/learner.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
#ifndef XGBOOST_LEARNER_H_
#define XGBOOST_LEARNER_H_

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

#include <dmlc/any.h>
#include <rabit/rabit.h>
#include <xgboost/base.h>
Expand All @@ -17,12 +23,6 @@
#include <xgboost/host_device_vector.h>
#include <xgboost/model.h>

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

namespace xgboost {

class Metric;
Expand Down
11 changes: 5 additions & 6 deletions include/xgboost/linear_updater.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
*/
#pragma once

#include <functional>
#include <string>
#include <utility>
#include <vector>

#include <dmlc/registry.h>
#include <xgboost/base.h>
#include <xgboost/data.h>
#include <xgboost/generic_parameters.h>
#include <xgboost/host_device_vector.h>
#include <xgboost/model.h>

#include <functional>
#include <string>
#include <utility>
#include <vector>


namespace xgboost {

class Json;
Expand Down
12 changes: 6 additions & 6 deletions include/xgboost/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
#ifndef XGBOOST_LOGGING_H_
#define XGBOOST_LOGGING_H_

#include <dmlc/logging.h>
#include <dmlc/thread_local.h>

#include <xgboost/base.h>
#include <xgboost/parameter.h>

#include <sstream>
#include <map>
#include <string>
#include <utility>
#include <vector>

#include <dmlc/logging.h>
#include <dmlc/thread_local.h>

#include <xgboost/base.h>
#include <xgboost/parameter.h>

namespace xgboost {

class BaseLogger {
Expand Down
10 changes: 5 additions & 5 deletions include/xgboost/metric.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
#ifndef XGBOOST_METRIC_H_
#define XGBOOST_METRIC_H_

#include <vector>
#include <string>
#include <functional>
#include <utility>

#include <dmlc/registry.h>
#include <xgboost/model.h>
#include <xgboost/generic_parameters.h>
#include <xgboost/data.h>
#include <xgboost/base.h>
#include <xgboost/host_device_vector.h>

#include <vector>
#include <string>
#include <functional>
#include <utility>

namespace xgboost {
/*!
* \brief interface of evaluation metric used to evaluate model performance.
Expand Down
10 changes: 5 additions & 5 deletions include/xgboost/objective.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
#ifndef XGBOOST_OBJECTIVE_H_
#define XGBOOST_OBJECTIVE_H_

#include <vector>
#include <utility>
#include <string>
#include <functional>

#include <dmlc/registry.h>
#include <xgboost/base.h>
#include <xgboost/data.h>
#include <xgboost/model.h>
#include <xgboost/generic_parameters.h>
#include <xgboost/host_device_vector.h>

#include <vector>
#include <utility>
#include <string>
#include <functional>

namespace xgboost {

/*! \brief interface of objective function */
Expand Down
5 changes: 3 additions & 2 deletions include/xgboost/parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
#ifndef XGBOOST_PARAMETER_H_
#define XGBOOST_PARAMETER_H_

#include <dmlc/parameter.h>
#include <xgboost/base.h>
#include <string>
#include <type_traits>

#include <dmlc/parameter.h>
#include <xgboost/base.h>

/*!
* \brief Specialization of FieldEntry for enum class (backed by int)
*
Expand Down
9 changes: 5 additions & 4 deletions include/xgboost/predictor.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
* performs predictions for a gradient booster.
*/
#pragma once
#include <xgboost/base.h>
#include <xgboost/data.h>
#include <xgboost/generic_parameters.h>
#include <xgboost/host_device_vector.h>

#include <functional>
#include <memory>
Expand All @@ -18,6 +14,11 @@
#include <vector>
#include <mutex>

#include <xgboost/base.h>
#include <xgboost/data.h>
#include <xgboost/generic_parameters.h>
#include <xgboost/host_device_vector.h>

// Forward declarations
namespace xgboost {
class TreeUpdater;
Expand Down
6 changes: 3 additions & 3 deletions include/xgboost/span.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
#ifndef XGBOOST_SPAN_H_
#define XGBOOST_SPAN_H_

#include <xgboost/base.h>
#include <xgboost/logging.h>

#include <cinttypes> // size_t
#include <limits> // numeric_limits
#include <iterator>
#include <type_traits>
#include <cstdio>

#include <xgboost/base.h>
#include <xgboost/logging.h>

/*!
* The version number 1910 is picked up from GSL.
*
Expand Down
16 changes: 8 additions & 8 deletions include/xgboost/tree_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
#ifndef XGBOOST_TREE_MODEL_H_
#define XGBOOST_TREE_MODEL_H_

#include <limits>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <tuple>
#include <stack>

#include <dmlc/io.h>
#include <dmlc/parameter.h>

Expand All @@ -16,14 +24,6 @@
#include <xgboost/feature_map.h>
#include <xgboost/model.h>

#include <limits>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <tuple>
#include <stack>

namespace xgboost {

struct PathElement; // forward declaration
Expand Down
10 changes: 5 additions & 5 deletions include/xgboost/tree_updater.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
#ifndef XGBOOST_TREE_UPDATER_H_
#define XGBOOST_TREE_UPDATER_H_

#include <functional>
#include <vector>
#include <utility>
#include <string>

#include <dmlc/registry.h>
#include <xgboost/base.h>
#include <xgboost/data.h>
Expand All @@ -16,11 +21,6 @@
#include <xgboost/host_device_vector.h>
#include <xgboost/model.h>

#include <functional>
#include <vector>
#include <utility>
#include <string>

namespace xgboost {

class Json;
Expand Down
Loading

0 comments on commit d3a0efb

Please sign in to comment.