some lint
This commit is contained in:
parent
e9bfc026b7
commit
c4b21775fa
@ -345,6 +345,7 @@ class FMatrixS : public FMatrixInterface<FMatrixS>{
|
|||||||
&col_data_[col_ptr_[i + 1]], Entry::CmpValue);
|
&col_data_[col_ptr_[i + 1]], Entry::CmpValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// --- data structure used to support InitColAccess --
|
// --- data structure used to support InitColAccess --
|
||||||
utils::IIterator<SparseBatch> *iter_;
|
utils::IIterator<SparseBatch> *iter_;
|
||||||
|
|||||||
@ -117,7 +117,7 @@ struct MetaInfo {
|
|||||||
}
|
}
|
||||||
// try to load weight information from file, if exists
|
// try to load weight information from file, if exists
|
||||||
inline bool TryLoadFloatInfo(const char *field, const char* fname, bool silent = false) {
|
inline bool TryLoadFloatInfo(const char *field, const char* fname, bool silent = false) {
|
||||||
std::vector<float> &weights = this->GetInfo(field);
|
std::vector<float> &weights = this->GetInfo(field);
|
||||||
FILE *fi = fopen64(fname, "r");
|
FILE *fi = fopen64(fname, "r");
|
||||||
if (fi == NULL) return false;
|
if (fi == NULL) return false;
|
||||||
float wt;
|
float wt;
|
||||||
|
|||||||
@ -74,11 +74,11 @@ inline int SampleBinary(double p) {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
inline void Shuffle(T *data, size_t sz) {
|
inline void Shuffle(T *data, size_t sz) {
|
||||||
if (sz == 0) return;
|
if (sz == 0) return;
|
||||||
for (uint32_t i = (uint32_t)sz - 1; i > 0; i--){
|
for (uint32_t i = (uint32_t)sz - 1; i > 0; i--) {
|
||||||
std::swap(data[i], data[NextUInt32(i + 1)]);
|
std::swap(data[i], data[NextUInt32(i + 1)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// random shuffle the data inside, require PRNG
|
// random shuffle the data inside, require PRNG
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline void Shuffle(std::vector<T> &data) {
|
inline void Shuffle(std::vector<T> &data) {
|
||||||
Shuffle(&data[0], data.size());
|
Shuffle(&data[0], data.size());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user