Fix r interaction constraints (#5543)

* Unify the parsing code.

* Cleanup.
This commit is contained in:
Jiaming Yuan
2020-04-18 06:53:51 +08:00
committed by GitHub
parent 93df871c8c
commit c245eb8755
8 changed files with 107 additions and 55 deletions

View File

@@ -15,12 +15,12 @@
namespace xgboost {
namespace {
struct FConstraintWrapper : public FeatureInteractionConstraint {
struct FConstraintWrapper : public FeatureInteractionConstraintDevice {
common::Span<LBitField64> GetNodeConstraints() {
return FeatureInteractionConstraint::s_node_constraints_;
return FeatureInteractionConstraintDevice::s_node_constraints_;
}
FConstraintWrapper(tree::TrainParam param, bst_feature_t n_features) :
FeatureInteractionConstraint(param, n_features) {}
FeatureInteractionConstraintDevice(param, n_features) {}
dh::device_vector<bst_feature_t> const& GetDSets() const {
return d_sets_;