pass trival test
This commit is contained in:
parent
226d26d40c
commit
f3360d173b
@ -46,9 +46,10 @@ class CSCMatrixManager {
|
|||||||
}
|
}
|
||||||
/*! \brief get underlying batch */
|
/*! \brief get underlying batch */
|
||||||
inline ColBatch GetBatch(void) const {
|
inline ColBatch GetBatch(void) const {
|
||||||
ColBatch batch;
|
ColBatch batch;
|
||||||
batch.col_index = &col_index[0];
|
batch.size = col_index.size();
|
||||||
batch.col_data = &col_data[0];
|
batch.col_index = BeginPtr(col_index);
|
||||||
|
batch.col_data = BeginPtr(col_data);
|
||||||
return batch;
|
return batch;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
@ -79,11 +80,13 @@ class CSCMatrixManager {
|
|||||||
col_index_ = col_todo_;
|
col_index_ = col_todo_;
|
||||||
read_top_ = 0;
|
read_top_ = 0;
|
||||||
}
|
}
|
||||||
inline bool LoadNext(PagePtr &val) {
|
inline bool LoadNext(PagePtr &val) {
|
||||||
val->Clear();
|
val->Clear();
|
||||||
if (read_top_ >= col_index_.size()) return false;
|
if (read_top_ >= col_index_.size()) return false;
|
||||||
while (read_top_ < col_index_.size()) {
|
while (read_top_ < col_index_.size()) {
|
||||||
if (!this->TryFill(col_index_[read_top_], val)) return true;
|
if (!this->TryFill(col_index_[read_top_], val)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
++read_top_;
|
++read_top_;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -241,11 +244,9 @@ class FMatrixPage : public IFMatrix {
|
|||||||
}
|
}
|
||||||
virtual void InitColAccess(float pkeep = 1.0f) {
|
virtual void InitColAccess(float pkeep = 1.0f) {
|
||||||
if (this->HaveColAccess()) return;
|
if (this->HaveColAccess()) return;
|
||||||
if (!this->LoadColData()) {
|
this->InitColData(pkeep, fname_cbuffer_.c_str(),
|
||||||
this->InitColData(pkeep, fname_cbuffer_.c_str(),
|
64 << 20, 5);
|
||||||
64 << 20, 5);
|
utils::Check(this->LoadColData(), "fail to read in column data");
|
||||||
utils::Check(this->LoadColData(), "fail to read in column data");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*!
|
/*!
|
||||||
* \brief get the row iterator associated with FMatrix
|
* \brief get the row iterator associated with FMatrix
|
||||||
|
|||||||
@ -421,7 +421,7 @@ class ColMaker: public IUpdater {
|
|||||||
for (bst_omp_uint i = 0; i < nsize; ++i) {
|
for (bst_omp_uint i = 0; i < nsize; ++i) {
|
||||||
const bst_uint fid = batch.col_index[i];
|
const bst_uint fid = batch.col_index[i];
|
||||||
const int tid = omp_get_thread_num();
|
const int tid = omp_get_thread_num();
|
||||||
const ColBatch::Inst c = batch[i];
|
const ColBatch::Inst c = batch[i];
|
||||||
if (param.need_forward_search(fmat.GetColDensity(fid))) {
|
if (param.need_forward_search(fmat.GetColDensity(fid))) {
|
||||||
this->EnumerateSplit(c.data, c.data + c.length, +1,
|
this->EnumerateSplit(c.data, c.data + c.length, +1,
|
||||||
fid, gpair, info, stemp[tid]);
|
fid, gpair, info, stemp[tid]);
|
||||||
@ -452,6 +452,7 @@ class ColMaker: public IUpdater {
|
|||||||
utils::Check(n > 0, "colsample_bylevel is too small that no feature can be included");
|
utils::Check(n > 0, "colsample_bylevel is too small that no feature can be included");
|
||||||
feat_set.resize(n);
|
feat_set.resize(n);
|
||||||
}
|
}
|
||||||
|
std::sort(feat_set.begin(), feat_set.end());
|
||||||
utils::IIterator<ColBatch> *iter = p_fmat->ColIterator(feat_set);
|
utils::IIterator<ColBatch> *iter = p_fmat->ColIterator(feat_set);
|
||||||
while (iter->Next()) {
|
while (iter->Next()) {
|
||||||
this->UpdateSolution(iter->Value(), gpair, *p_fmat, info);
|
this->UpdateSolution(iter->Value(), gpair, *p_fmat, info);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user