pass fmatrix as const

This commit is contained in:
tqchen
2014-08-15 21:24:23 -07:00
parent d9dbd1efc6
commit ac1cc15b90
5 changed files with 11 additions and 8 deletions

View File

@@ -46,7 +46,7 @@ class IGradBooster {
* root_index.size() can be 0 which indicates that no pre-partition involved
*/
virtual void DoBoost(const std::vector<bst_gpair> &gpair,
FMatrix &fmat,
const FMatrix &fmat,
const std::vector<unsigned> &root_index) = 0;
/*!
* \brief generate predictions for given feature matrix

View File

@@ -83,7 +83,7 @@ class GBTree : public IGradBooster<FMatrix> {
utils::Assert(trees.size() == 0, "GBTree: model already initialized");
}
virtual void DoBoost(const std::vector<bst_gpair> &gpair,
FMatrix &fmat,
const FMatrix &fmat,
const std::vector<unsigned> &root_index) {
if (mparam.num_output_group == 1) {
this->BoostNewTrees(gpair, fmat, root_index, 0);
@@ -174,7 +174,7 @@ class GBTree : public IGradBooster<FMatrix> {
}
// do group specific group
inline void BoostNewTrees(const std::vector<bst_gpair> &gpair,
FMatrix &fmat,
const FMatrix &fmat,
const std::vector<unsigned> &root_index,
int bst_group) {
this->InitUpdater();