This commit is contained in:
tqchen 2014-03-03 22:20:45 -08:00 committed by tqchen
parent 9da9861377
commit cba130c40c
2 changed files with 17 additions and 17 deletions

View File

@ -6,6 +6,12 @@
* \author Tianqi Chen: tianqi.tchen@gmail.com * \author Tianqi Chen: tianqi.tchen@gmail.com
*/ */
// implementation of boosters go to here // implementation of boosters go to here
// A good design should have minimum functions defined interface, user should only operate on interface
// I break it a bit, by using template and let user 'see' the implementation
// The user should pretend that they only can use the interface, and we are all cool
// I find this is the only way so far I can think of to make boosters invariant of data structure,
// while keep everything fast
#include "xgboost.h" #include "xgboost.h"
#include "../utils/xgboost_utils.h" #include "../utils/xgboost_utils.h"
#include "tree/xgboost_tree.hpp" #include "tree/xgboost_tree.hpp"
@ -27,7 +33,7 @@ namespace xgboost{
default: utils::Error("unknown booster_type"); return NULL; default: utils::Error("unknown booster_type"); return NULL;
} }
} }
}; }; // namespace booster
}; }; // namespace xgboost
#endif // XGBOOST_INL_HPP #endif // XGBOOST_INL_HPP

View File

@ -150,12 +150,6 @@ namespace xgboost{
}; };
}; };
// A good design should have minimum functions defined interface, user should only operate on interface
// I break it a bit, by using template and let user 'see' the implementation
// The user should pretend that they only can use the interface, and we are all cool
// I find this is the only way so far I can think of to make boosters invariant of data structure,
// while keep everything fast
// this file includes the template implementations of all boosters // this file includes the template implementations of all boosters
// the cost of using template is that the user can 'see' all the implementations, which is OK // the cost of using template is that the user can 'see' all the implementations, which is OK
// ignore implementations and focus on the interface:) // ignore implementations and focus on the interface:)