Remove some unused functions as reported by cppcheck (#4743)
This commit is contained in:
parent
3e2c472944
commit
602484e19f
@ -47,7 +47,7 @@ struct BitMap {
|
|||||||
for (bst_omp_uint i = 0; i < nsize; ++i) {
|
for (bst_omp_uint i = 0; i < nsize; ++i) {
|
||||||
uint32_t res = 0;
|
uint32_t res = 0;
|
||||||
for (int k = 0; k < 32; ++k) {
|
for (int k = 0; k < 32; ++k) {
|
||||||
int bit = vec[(i << 5) | k];
|
uint32_t bit = vec[(i << 5) | k];
|
||||||
res |= (bit << k);
|
res |= (bit << k);
|
||||||
}
|
}
|
||||||
data[i] = res;
|
data[i] = res;
|
||||||
|
|||||||
@ -31,13 +31,13 @@ const char* kMaxDeltaStepDefaultValue = "0.7";
|
|||||||
|
|
||||||
inline bool IsFloat(const std::string& str) {
|
inline bool IsFloat(const std::string& str) {
|
||||||
std::stringstream ss(str);
|
std::stringstream ss(str);
|
||||||
float f;
|
float f{};
|
||||||
return !((ss >> std::noskipws >> f).rdstate() ^ std::ios_base::eofbit);
|
return !((ss >> std::noskipws >> f).rdstate() ^ std::ios_base::eofbit);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool IsInt(const std::string& str) {
|
inline bool IsInt(const std::string& str) {
|
||||||
std::stringstream ss(str);
|
std::stringstream ss(str);
|
||||||
int i;
|
int i{};
|
||||||
return !((ss >> std::noskipws >> i).rdstate() ^ std::ios_base::eofbit);
|
return !((ss >> std::noskipws >> i).rdstate() ^ std::ios_base::eofbit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -535,9 +535,6 @@ class LearnerImpl : public Learner {
|
|||||||
gbm_->PredictBatch(data, out_preds, ntree_limit);
|
gbm_->PredictBatch(data, out_preds, ntree_limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// return whether model is already initialized.
|
|
||||||
bool ModelInitialized() const { return configured_; }
|
|
||||||
|
|
||||||
void ConfigureObjective(LearnerTrainParam const& old, Args* p_args) {
|
void ConfigureObjective(LearnerTrainParam const& old, Args* p_args) {
|
||||||
if (cfg_.find("num_class") != cfg_.cend() && cfg_.at("num_class") != "0") {
|
if (cfg_.find("num_class") != cfg_.cend() && cfg_.at("num_class") != "0") {
|
||||||
cfg_["num_output_group"] = cfg_["num_class"];
|
cfg_["num_output_group"] = cfg_["num_class"];
|
||||||
|
|||||||
@ -146,10 +146,6 @@ class LambdaRankObj : public ObjFunction {
|
|||||||
inline static bool CmpPred(const ListEntry &a, const ListEntry &b) {
|
inline static bool CmpPred(const ListEntry &a, const ListEntry &b) {
|
||||||
return a.pred > b.pred;
|
return a.pred > b.pred;
|
||||||
}
|
}
|
||||||
// comparator by label
|
|
||||||
inline static bool CmpLabel(const ListEntry &a, const ListEntry &b) {
|
|
||||||
return a.label > b.label;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
/*! \brief a pair in the lambda rank */
|
/*! \brief a pair in the lambda rank */
|
||||||
struct LambdaPair {
|
struct LambdaPair {
|
||||||
|
|||||||
@ -817,9 +817,6 @@ class DistColMaker : public ColMaker {
|
|||||||
this->position_[ridx] = nid;
|
this->position_[ridx] = nid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
inline const int* GetLeafPosition() const {
|
|
||||||
return dmlc::BeginPtr(this->position_);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void SetNonDefaultPosition(const std::vector<int> &qexpand, DMatrix *p_fmat,
|
void SetNonDefaultPosition(const std::vector<int> &qexpand, DMatrix *p_fmat,
|
||||||
|
|||||||
@ -96,16 +96,6 @@ class HistMaker: public BaseMaker {
|
|||||||
hset[tid].data.resize(cut.size(), GradStats());
|
hset[tid].data.resize(cut.size(), GradStats());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// aggregate all statistics to hset[0]
|
|
||||||
inline void Aggregate() {
|
|
||||||
bst_omp_uint nsize = static_cast<bst_omp_uint>(cut.size());
|
|
||||||
#pragma omp parallel for schedule(static)
|
|
||||||
for (bst_omp_uint i = 0; i < nsize; ++i) {
|
|
||||||
for (size_t tid = 1; tid < hset.size(); ++tid) {
|
|
||||||
hset[0].data[i].Add(hset[tid].data[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*! \brief clear the workspace */
|
/*! \brief clear the workspace */
|
||||||
inline void Clear() {
|
inline void Clear() {
|
||||||
cut.clear(); rptr.resize(1); rptr[0] = 0;
|
cut.clear(); rptr.resize(1); rptr[0] = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user