Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
462612b4
Commit
462612b4
authored
Feb 06, 2019
by
Nikita Titov
Committed by
Guolin Ke
Feb 06, 2019
Browse files
fixed modifiers indent (#1997)
parent
8e286b38
Changes
54
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
46 additions
and
45 deletions
+46
-45
include/LightGBM/application.h
include/LightGBM/application.h
+2
-2
include/LightGBM/bin.h
include/LightGBM/bin.h
+6
-6
include/LightGBM/boosting.h
include/LightGBM/boosting.h
+2
-2
include/LightGBM/config.h
include/LightGBM/config.h
+2
-2
include/LightGBM/dataset.h
include/LightGBM/dataset.h
+5
-5
include/LightGBM/dataset_loader.h
include/LightGBM/dataset_loader.h
+2
-2
include/LightGBM/feature_group.h
include/LightGBM/feature_group.h
+2
-2
include/LightGBM/json11.hpp
include/LightGBM/json11.hpp
+2
-2
include/LightGBM/metric.h
include/LightGBM/metric.h
+3
-3
include/LightGBM/network.h
include/LightGBM/network.h
+4
-4
include/LightGBM/objective_function.h
include/LightGBM/objective_function.h
+1
-1
include/LightGBM/tree.h
include/LightGBM/tree.h
+2
-2
include/LightGBM/tree_learner.h
include/LightGBM/tree_learner.h
+1
-1
include/LightGBM/utils/array_args.h
include/LightGBM/utils/array_args.h
+1
-1
include/LightGBM/utils/log.h
include/LightGBM/utils/log.h
+2
-2
include/LightGBM/utils/openmp_wrapper.h
include/LightGBM/utils/openmp_wrapper.h
+3
-2
include/LightGBM/utils/pipeline_reader.h
include/LightGBM/utils/pipeline_reader.h
+1
-1
include/LightGBM/utils/random.h
include/LightGBM/utils/random.h
+2
-2
include/LightGBM/utils/text_reader.h
include/LightGBM/utils/text_reader.h
+2
-2
include/LightGBM/utils/threading.h
include/LightGBM/utils/threading.h
+1
-1
No files found.
include/LightGBM/application.h
View file @
462612b4
...
@@ -23,7 +23,7 @@ class Metric;
...
@@ -23,7 +23,7 @@ class Metric;
* and save the score to disk.
* and save the score to disk.
*/
*/
class
Application
{
class
Application
{
public:
public:
Application
(
int
argc
,
char
**
argv
);
Application
(
int
argc
,
char
**
argv
);
/*! \brief Destructor */
/*! \brief Destructor */
...
@@ -32,7 +32,7 @@ public:
...
@@ -32,7 +32,7 @@ public:
/*! \brief To call this funciton to run application*/
/*! \brief To call this funciton to run application*/
inline
void
Run
();
inline
void
Run
();
private:
private:
/*! \brief Load parameters from command line and config file*/
/*! \brief Load parameters from command line and config file*/
void
LoadParameters
(
int
argc
,
char
**
argv
);
void
LoadParameters
(
int
argc
,
char
**
argv
);
...
...
include/LightGBM/bin.h
View file @
462612b4
...
@@ -27,7 +27,7 @@ enum MissingType {
...
@@ -27,7 +27,7 @@ enum MissingType {
/*! \brief Store data for one histogram bin */
/*! \brief Store data for one histogram bin */
struct
HistogramBinEntry
{
struct
HistogramBinEntry
{
public:
public:
/*! \brief Sum of gradients on this bin */
/*! \brief Sum of gradients on this bin */
double
sum_gradients
=
0.0
f
;
double
sum_gradients
=
0.0
f
;
/*! \brief Sum of hessians on this bin */
/*! \brief Sum of hessians on this bin */
...
@@ -59,7 +59,7 @@ public:
...
@@ -59,7 +59,7 @@ public:
/*! \brief This class used to convert feature values into bin,
/*! \brief This class used to convert feature values into bin,
* and store some meta information for bin*/
* and store some meta information for bin*/
class
BinMapper
{
class
BinMapper
{
public:
public:
BinMapper
();
BinMapper
();
BinMapper
(
const
BinMapper
&
other
);
BinMapper
(
const
BinMapper
&
other
);
explicit
BinMapper
(
const
void
*
memory
);
explicit
BinMapper
(
const
void
*
memory
);
...
@@ -184,7 +184,7 @@ public:
...
@@ -184,7 +184,7 @@ public:
}
}
}
}
private:
private:
/*! \brief Number of bins */
/*! \brief Number of bins */
int
num_bin_
;
int
num_bin_
;
MissingType
missing_type_
;
MissingType
missing_type_
;
...
@@ -217,7 +217,7 @@ private:
...
@@ -217,7 +217,7 @@ private:
* So we only using ordered bin for sparse situations.
* So we only using ordered bin for sparse situations.
*/
*/
class
OrderedBin
{
class
OrderedBin
{
public:
public:
/*! \brief virtual destructor */
/*! \brief virtual destructor */
virtual
~
OrderedBin
()
{}
virtual
~
OrderedBin
()
{}
...
@@ -265,7 +265,7 @@ public:
...
@@ -265,7 +265,7 @@ public:
/*! \brief Iterator for one bin column */
/*! \brief Iterator for one bin column */
class
BinIterator
{
class
BinIterator
{
public:
public:
/*!
/*!
* \brief Get bin data on specific row index
* \brief Get bin data on specific row index
* \param idx Index of this data
* \param idx Index of this data
...
@@ -284,7 +284,7 @@ public:
...
@@ -284,7 +284,7 @@ public:
* but it doesn't need to re-order operation, So it will be faster than OrderedBin for dense feature
* but it doesn't need to re-order operation, So it will be faster than OrderedBin for dense feature
*/
*/
class
Bin
{
class
Bin
{
public:
public:
/*! \brief virtual destructor */
/*! \brief virtual destructor */
virtual
~
Bin
()
{}
virtual
~
Bin
()
{}
/*!
/*!
...
...
include/LightGBM/boosting.h
View file @
462612b4
...
@@ -20,7 +20,7 @@ struct PredictionEarlyStopInstance;
...
@@ -20,7 +20,7 @@ struct PredictionEarlyStopInstance;
* \brief The interface for Boosting
* \brief The interface for Boosting
*/
*/
class
LIGHTGBM_EXPORT
Boosting
{
class
LIGHTGBM_EXPORT
Boosting
{
public:
public:
/*! \brief virtual destructor */
/*! \brief virtual destructor */
virtual
~
Boosting
()
{}
virtual
~
Boosting
()
{}
...
@@ -294,7 +294,7 @@ public:
...
@@ -294,7 +294,7 @@ public:
};
};
class
GBDTBase
:
public
Boosting
{
class
GBDTBase
:
public
Boosting
{
public:
public:
virtual
double
GetLeafValue
(
int
tree_idx
,
int
leaf_idx
)
const
=
0
;
virtual
double
GetLeafValue
(
int
tree_idx
,
int
leaf_idx
)
const
=
0
;
virtual
void
SetLeafValue
(
int
tree_idx
,
int
leaf_idx
,
double
val
)
=
0
;
virtual
void
SetLeafValue
(
int
tree_idx
,
int
leaf_idx
,
double
val
)
=
0
;
};
};
...
...
include/LightGBM/config.h
View file @
462612b4
...
@@ -25,7 +25,7 @@ enum TaskType {
...
@@ -25,7 +25,7 @@ enum TaskType {
const
int
kDefaultNumLeaves
=
31
;
const
int
kDefaultNumLeaves
=
31
;
struct
Config
{
struct
Config
{
public:
public:
std
::
string
ToString
()
const
;
std
::
string
ToString
()
const
;
/*!
/*!
* \brief Get string value by specific name of key
* \brief Get string value by specific name of key
...
@@ -772,7 +772,7 @@ public:
...
@@ -772,7 +772,7 @@ public:
static
std
::
unordered_map
<
std
::
string
,
std
::
string
>
alias_table
;
static
std
::
unordered_map
<
std
::
string
,
std
::
string
>
alias_table
;
static
std
::
unordered_set
<
std
::
string
>
parameter_set
;
static
std
::
unordered_set
<
std
::
string
>
parameter_set
;
private:
private:
void
CheckParamConflict
();
void
CheckParamConflict
();
void
GetMembersFromString
(
const
std
::
unordered_map
<
std
::
string
,
std
::
string
>&
params
);
void
GetMembersFromString
(
const
std
::
unordered_map
<
std
::
string
,
std
::
string
>&
params
);
std
::
string
SaveMembersToString
()
const
;
std
::
string
SaveMembersToString
()
const
;
...
...
include/LightGBM/dataset.h
View file @
462612b4
...
@@ -34,7 +34,7 @@ class DatasetLoader;
...
@@ -34,7 +34,7 @@ class DatasetLoader;
* 5. Initial score. optional. if exsitng, the model will boost from this score, otherwise will start from 0.
* 5. Initial score. optional. if exsitng, the model will boost from this score, otherwise will start from 0.
*/
*/
class
Metadata
{
class
Metadata
{
public:
public:
/*!
/*!
* \brief Null costructor
* \brief Null costructor
*/
*/
...
@@ -206,7 +206,7 @@ public:
...
@@ -206,7 +206,7 @@ public:
/*! \brief Disable copy */
/*! \brief Disable copy */
Metadata
(
const
Metadata
&
)
=
delete
;
Metadata
(
const
Metadata
&
)
=
delete
;
private:
private:
/*! \brief Load initial scores from file */
/*! \brief Load initial scores from file */
void
LoadInitialScore
(
const
char
*
initscore_file
);
void
LoadInitialScore
(
const
char
*
initscore_file
);
/*! \brief Load wights from file */
/*! \brief Load wights from file */
...
@@ -247,7 +247,7 @@ private:
...
@@ -247,7 +247,7 @@ private:
/*! \brief Interface for Parser */
/*! \brief Interface for Parser */
class
Parser
{
class
Parser
{
public:
public:
/*! \brief virtual destructor */
/*! \brief virtual destructor */
virtual
~
Parser
()
{}
virtual
~
Parser
()
{}
...
@@ -276,7 +276,7 @@ public:
...
@@ -276,7 +276,7 @@ public:
* which are used to traning or validation
* which are used to traning or validation
*/
*/
class
Dataset
{
class
Dataset
{
public:
public:
friend
DatasetLoader
;
friend
DatasetLoader
;
LIGHTGBM_EXPORT
Dataset
();
LIGHTGBM_EXPORT
Dataset
();
...
@@ -581,7 +581,7 @@ public:
...
@@ -581,7 +581,7 @@ public:
/*! \brief Disable copy */
/*! \brief Disable copy */
Dataset
(
const
Dataset
&
)
=
delete
;
Dataset
(
const
Dataset
&
)
=
delete
;
private:
private:
std
::
string
data_filename_
;
std
::
string
data_filename_
;
/*! \brief Store used features */
/*! \brief Store used features */
std
::
vector
<
std
::
unique_ptr
<
FeatureGroup
>>
feature_groups_
;
std
::
vector
<
std
::
unique_ptr
<
FeatureGroup
>>
feature_groups_
;
...
...
include/LightGBM/dataset_loader.h
View file @
462612b4
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
namespace
LightGBM
{
namespace
LightGBM
{
class
DatasetLoader
{
class
DatasetLoader
{
public:
public:
LIGHTGBM_EXPORT
DatasetLoader
(
const
Config
&
io_config
,
const
PredictFunction
&
predict_fun
,
int
num_class
,
const
char
*
filename
);
LIGHTGBM_EXPORT
DatasetLoader
(
const
Config
&
io_config
,
const
PredictFunction
&
predict_fun
,
int
num_class
,
const
char
*
filename
);
LIGHTGBM_EXPORT
~
DatasetLoader
();
LIGHTGBM_EXPORT
~
DatasetLoader
();
...
@@ -28,7 +28,7 @@ public:
...
@@ -28,7 +28,7 @@ public:
/*! \brief Disable copy */
/*! \brief Disable copy */
DatasetLoader
(
const
DatasetLoader
&
)
=
delete
;
DatasetLoader
(
const
DatasetLoader
&
)
=
delete
;
private:
private:
Dataset
*
LoadFromBinFile
(
const
char
*
data_filename
,
const
char
*
bin_filename
,
int
rank
,
int
num_machines
,
int
*
num_global_data
,
std
::
vector
<
data_size_t
>*
used_data_indices
);
Dataset
*
LoadFromBinFile
(
const
char
*
data_filename
,
const
char
*
bin_filename
,
int
rank
,
int
num_machines
,
int
*
num_global_data
,
std
::
vector
<
data_size_t
>*
used_data_indices
);
void
SetHeader
(
const
char
*
filename
);
void
SetHeader
(
const
char
*
filename
);
...
...
include/LightGBM/feature_group.h
View file @
462612b4
...
@@ -16,7 +16,7 @@ class Dataset;
...
@@ -16,7 +16,7 @@ class Dataset;
class
DatasetLoader
;
class
DatasetLoader
;
/*! \brief Using to store data and providing some operations on one feature group*/
/*! \brief Using to store data and providing some operations on one feature group*/
class
FeatureGroup
{
class
FeatureGroup
{
public:
public:
friend
Dataset
;
friend
Dataset
;
friend
DatasetLoader
;
friend
DatasetLoader
;
/*!
/*!
...
@@ -214,7 +214,7 @@ public:
...
@@ -214,7 +214,7 @@ public:
/*! \brief Disable copy */
/*! \brief Disable copy */
FeatureGroup
(
const
FeatureGroup
&
)
=
delete
;
FeatureGroup
(
const
FeatureGroup
&
)
=
delete
;
private:
private:
/*! \brief Number of features */
/*! \brief Number of features */
int
num_feature_
;
int
num_feature_
;
/*! \brief Bin mapper for sub features */
/*! \brief Bin mapper for sub features */
...
...
include/LightGBM/json11.hpp
View file @
462612b4
...
@@ -204,13 +204,13 @@ public:
...
@@ -204,13 +204,13 @@ public:
typedef
std
::
initializer_list
<
std
::
pair
<
std
::
string
,
Type
>>
shape
;
typedef
std
::
initializer_list
<
std
::
pair
<
std
::
string
,
Type
>>
shape
;
bool
has_shape
(
const
shape
&
types
,
std
::
string
&
err
)
const
;
bool
has_shape
(
const
shape
&
types
,
std
::
string
&
err
)
const
;
private:
private:
std
::
shared_ptr
<
JsonValue
>
m_ptr
;
std
::
shared_ptr
<
JsonValue
>
m_ptr
;
};
};
// Internal class hierarchy - JsonValue objects are not exposed to users of this API.
// Internal class hierarchy - JsonValue objects are not exposed to users of this API.
class
JsonValue
{
class
JsonValue
{
protected:
protected:
friend
class
Json
;
friend
class
Json
;
friend
class
JsonInt
;
friend
class
JsonInt
;
friend
class
JsonDouble
;
friend
class
JsonDouble
;
...
...
include/LightGBM/metric.h
View file @
462612b4
...
@@ -18,7 +18,7 @@ namespace LightGBM {
...
@@ -18,7 +18,7 @@ namespace LightGBM {
* Metric is used to calculate metric result
* Metric is used to calculate metric result
*/
*/
class
Metric
{
class
Metric
{
public:
public:
/*! \brief virtual destructor */
/*! \brief virtual destructor */
virtual
~
Metric
()
{}
virtual
~
Metric
()
{}
...
@@ -57,7 +57,7 @@ public:
...
@@ -57,7 +57,7 @@ public:
* \brief Static class, used to calculate DCG score
* \brief Static class, used to calculate DCG score
*/
*/
class
DCGCalculator
{
class
DCGCalculator
{
public:
public:
static
void
DefaultEvalAt
(
std
::
vector
<
int
>*
eval_at
);
static
void
DefaultEvalAt
(
std
::
vector
<
int
>*
eval_at
);
static
void
DefaultLabelGain
(
std
::
vector
<
double
>*
label_gain
);
static
void
DefaultLabelGain
(
std
::
vector
<
double
>*
label_gain
);
/*!
/*!
...
@@ -123,7 +123,7 @@ public:
...
@@ -123,7 +123,7 @@ public:
*/
*/
inline
static
double
GetDiscount
(
data_size_t
k
)
{
return
discount_
[
k
];
}
inline
static
double
GetDiscount
(
data_size_t
k
)
{
return
discount_
[
k
];
}
private:
private:
/*! \brief store gains for different label */
/*! \brief store gains for different label */
static
std
::
vector
<
double
>
label_gain_
;
static
std
::
vector
<
double
>
label_gain_
;
/*! \brief store discount score for different position */
/*! \brief store discount score for different position */
...
...
include/LightGBM/network.h
View file @
462612b4
...
@@ -17,7 +17,7 @@ class Linkers;
...
@@ -17,7 +17,7 @@ class Linkers;
/*! \brief The network structure for all_gather */
/*! \brief The network structure for all_gather */
class
BruckMap
{
class
BruckMap
{
public:
public:
/*! \brief The communication times for one all gather operation */
/*! \brief The communication times for one all gather operation */
int
k
;
int
k
;
/*! \brief in_ranks[i] means the incomming rank on i-th communication */
/*! \brief in_ranks[i] means the incomming rank on i-th communication */
...
@@ -51,7 +51,7 @@ enum RecursiveHalvingNodeType {
...
@@ -51,7 +51,7 @@ enum RecursiveHalvingNodeType {
/*! \brief Network structure for recursive halving algorithm */
/*! \brief Network structure for recursive halving algorithm */
class
RecursiveHalvingMap
{
class
RecursiveHalvingMap
{
public:
public:
/*! \brief Communication times for one recursize halving algorithm */
/*! \brief Communication times for one recursize halving algorithm */
int
k
;
int
k
;
/*! \brief Node type */
/*! \brief Node type */
...
@@ -84,7 +84,7 @@ public:
...
@@ -84,7 +84,7 @@ public:
/*! \brief A static class that contains some collective communication algorithm */
/*! \brief A static class that contains some collective communication algorithm */
class
Network
{
class
Network
{
public:
public:
/*!
/*!
* \brief Initialize
* \brief Initialize
* \param config Config of network setting
* \param config Config of network setting
...
@@ -256,7 +256,7 @@ public:
...
@@ -256,7 +256,7 @@ public:
}
}
}
}
private:
private:
static
void
AllgatherBruck
(
char
*
input
,
const
comm_size_t
*
block_start
,
const
comm_size_t
*
block_len
,
char
*
output
,
comm_size_t
all_size
);
static
void
AllgatherBruck
(
char
*
input
,
const
comm_size_t
*
block_start
,
const
comm_size_t
*
block_len
,
char
*
output
,
comm_size_t
all_size
);
static
void
AllgatherRecursiveDoubling
(
char
*
input
,
const
comm_size_t
*
block_start
,
const
comm_size_t
*
block_len
,
char
*
output
,
comm_size_t
all_size
);
static
void
AllgatherRecursiveDoubling
(
char
*
input
,
const
comm_size_t
*
block_start
,
const
comm_size_t
*
block_len
,
char
*
output
,
comm_size_t
all_size
);
...
...
include/LightGBM/objective_function.h
View file @
462612b4
...
@@ -11,7 +11,7 @@ namespace LightGBM {
...
@@ -11,7 +11,7 @@ namespace LightGBM {
* \brief The interface of Objective Function.
* \brief The interface of Objective Function.
*/
*/
class
ObjectiveFunction
{
class
ObjectiveFunction
{
public:
public:
/*! \brief virtual destructor */
/*! \brief virtual destructor */
virtual
~
ObjectiveFunction
()
{}
virtual
~
ObjectiveFunction
()
{}
...
...
include/LightGBM/tree.h
View file @
462612b4
...
@@ -18,7 +18,7 @@ namespace LightGBM {
...
@@ -18,7 +18,7 @@ namespace LightGBM {
* \brief Tree model
* \brief Tree model
*/
*/
class
Tree
{
class
Tree
{
public:
public:
/*!
/*!
* \brief Constructor
* \brief Constructor
* \param max_leaves The number of max leaves
* \param max_leaves The number of max leaves
...
@@ -203,7 +203,7 @@ public:
...
@@ -203,7 +203,7 @@ public:
void
RecomputeMaxDepth
();
void
RecomputeMaxDepth
();
private:
private:
std
::
string
NumericalDecisionIfElse
(
int
node
)
const
;
std
::
string
NumericalDecisionIfElse
(
int
node
)
const
;
std
::
string
CategoricalDecisionIfElse
(
int
node
)
const
;
std
::
string
CategoricalDecisionIfElse
(
int
node
)
const
;
...
...
include/LightGBM/tree_learner.h
View file @
462612b4
...
@@ -21,7 +21,7 @@ class ObjectiveFunction;
...
@@ -21,7 +21,7 @@ class ObjectiveFunction;
* \brief Interface for tree learner
* \brief Interface for tree learner
*/
*/
class
TreeLearner
{
class
TreeLearner
{
public:
public:
/*! \brief virtual destructor */
/*! \brief virtual destructor */
virtual
~
TreeLearner
()
{}
virtual
~
TreeLearner
()
{}
...
...
include/LightGBM/utils/array_args.h
View file @
462612b4
...
@@ -12,7 +12,7 @@ namespace LightGBM {
...
@@ -12,7 +12,7 @@ namespace LightGBM {
*/
*/
template
<
typename
VAL_T
>
template
<
typename
VAL_T
>
class
ArrayArgs
{
class
ArrayArgs
{
public:
public:
inline
static
size_t
ArgMaxMT
(
const
std
::
vector
<
VAL_T
>&
array
)
{
inline
static
size_t
ArgMaxMT
(
const
std
::
vector
<
VAL_T
>&
array
)
{
int
num_threads
=
1
;
int
num_threads
=
1
;
#pragma omp parallel
#pragma omp parallel
...
...
include/LightGBM/utils/log.h
View file @
462612b4
...
@@ -41,7 +41,7 @@ enum class LogLevel: int {
...
@@ -41,7 +41,7 @@ enum class LogLevel: int {
* \brief A static Log class
* \brief A static Log class
*/
*/
class
Log
{
class
Log
{
public:
public:
/*!
/*!
* \brief Resets the minimal log level. It is INFO by default.
* \brief Resets the minimal log level. It is INFO by default.
* \param level The new minimal log level.
* \param level The new minimal log level.
...
@@ -83,7 +83,7 @@ public:
...
@@ -83,7 +83,7 @@ public:
throw
std
::
runtime_error
(
std
::
string
(
str_buf
));
throw
std
::
runtime_error
(
std
::
string
(
str_buf
));
}
}
private:
private:
static
void
Write
(
LogLevel
level
,
const
char
*
level_str
,
const
char
*
format
,
va_list
val
)
{
static
void
Write
(
LogLevel
level
,
const
char
*
level_str
,
const
char
*
format
,
va_list
val
)
{
if
(
level
<=
GetLevel
())
{
// omit the message with low level
if
(
level
<=
GetLevel
())
{
// omit the message with low level
// write to STDOUT
// write to STDOUT
...
...
include/LightGBM/utils/openmp_wrapper.h
View file @
462612b4
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#include "log.h"
#include "log.h"
class
ThreadExceptionHelper
{
class
ThreadExceptionHelper
{
public:
public:
ThreadExceptionHelper
()
{
ThreadExceptionHelper
()
{
ex_ptr_
=
nullptr
;
ex_ptr_
=
nullptr
;
}
}
...
@@ -31,7 +31,8 @@ public:
...
@@ -31,7 +31,8 @@ public:
if
(
ex_ptr_
!=
nullptr
)
{
return
;
}
if
(
ex_ptr_
!=
nullptr
)
{
return
;
}
ex_ptr_
=
std
::
current_exception
();
ex_ptr_
=
std
::
current_exception
();
}
}
private:
private:
std
::
exception_ptr
ex_ptr_
;
std
::
exception_ptr
ex_ptr_
;
std
::
mutex
lock_
;
std
::
mutex
lock_
;
};
};
...
...
include/LightGBM/utils/pipeline_reader.h
View file @
462612b4
...
@@ -18,7 +18,7 @@ namespace LightGBM {
...
@@ -18,7 +18,7 @@ namespace LightGBM {
* \brief A pipeline file reader, use 2 threads, one read block from file, the other process the block
* \brief A pipeline file reader, use 2 threads, one read block from file, the other process the block
*/
*/
class
PipelineReader
{
class
PipelineReader
{
public:
public:
/*!
/*!
* \brief Read data from a file, use pipeline methods
* \brief Read data from a file, use pipeline methods
* \param filename Filename of data
* \param filename Filename of data
...
...
include/LightGBM/utils/random.h
View file @
462612b4
...
@@ -13,7 +13,7 @@ namespace LightGBM {
...
@@ -13,7 +13,7 @@ namespace LightGBM {
* \brief A wrapper for random generator
* \brief A wrapper for random generator
*/
*/
class
Random
{
class
Random
{
public:
public:
/*!
/*!
* \brief Constructor, with random seed
* \brief Constructor, with random seed
*/
*/
...
@@ -94,7 +94,7 @@ public:
...
@@ -94,7 +94,7 @@ public:
return
ret
;
return
ret
;
}
}
private:
private:
inline
int
RandInt16
()
{
inline
int
RandInt16
()
{
x
=
(
214013
*
x
+
2531011
);
x
=
(
214013
*
x
+
2531011
);
return
static_cast
<
int
>
((
x
>>
16
)
&
0x7FFF
);
return
static_cast
<
int
>
((
x
>>
16
)
&
0x7FFF
);
...
...
include/LightGBM/utils/text_reader.h
View file @
462612b4
...
@@ -19,7 +19,7 @@ namespace LightGBM {
...
@@ -19,7 +19,7 @@ namespace LightGBM {
*/
*/
template
<
typename
INDEX_T
>
template
<
typename
INDEX_T
>
class
TextReader
{
class
TextReader
{
public:
public:
/*!
/*!
* \brief Constructor
* \brief Constructor
* \param filename Filename of data
* \param filename Filename of data
...
@@ -306,7 +306,7 @@ public:
...
@@ -306,7 +306,7 @@ public:
});
});
}
}
private:
private:
/*! \brief Filename of text data */
/*! \brief Filename of text data */
const
char
*
filename_
;
const
char
*
filename_
;
/*! \brief Cache the read text data */
/*! \brief Cache the read text data */
...
...
include/LightGBM/utils/threading.h
View file @
462612b4
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
namespace
LightGBM
{
namespace
LightGBM
{
class
Threading
{
class
Threading
{
public:
public:
template
<
typename
INDEX_T
>
template
<
typename
INDEX_T
>
static
inline
void
For
(
INDEX_T
start
,
INDEX_T
end
,
const
std
::
function
<
void
(
int
,
INDEX_T
,
INDEX_T
)
>&
inner_fun
)
{
static
inline
void
For
(
INDEX_T
start
,
INDEX_T
end
,
const
std
::
function
<
void
(
int
,
INDEX_T
,
INDEX_T
)
>&
inner_fun
)
{
int
num_threads
=
1
;
int
num_threads
=
1
;
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment