22 #define FLATNODE_HD __host__ __device__
33 template <
typename DataT,
typename LabelT,
typename IdxT =
int>
37 DataT quesval = DataT(0);
38 DataT best_metric_val = DataT(0);
39 IdxT left_child_id = -1;
40 IdxT instance_count = 0;
42 IdxT colid, DataT quesval, DataT best_metric_val, int64_t left_child_id, IdxT instance_count)
45 best_metric_val(best_metric_val),
46 left_child_id(left_child_id),
47 instance_count(instance_count)
60 IdxT colid, DataT quesval, DataT best_metric_val, int64_t left_child_id, IdxT instance_count)
63 colid, quesval, best_metric_val, left_child_id, instance_count};
72 return (this->colid == other.colid) && (this->quesval == other.quesval) &&
73 (this->best_metric_val == other.best_metric_val) &&
74 (this->left_child_id == other.left_child_id) &&
75 (this->instance_count == other.instance_count);
#define FLATNODE_HD
Definition: flatnode.h:24
Definition: flatnode.h:34
static FLATNODE_HD SparseTreeNode CreateSplitNode(IdxT colid, DataT quesval, DataT best_metric_val, int64_t left_child_id, IdxT instance_count)
Definition: flatnode.h:59
FLATNODE_HD int64_t LeftChildId() const
Definition: flatnode.h:55
bool operator==(const SparseTreeNode &other) const
Definition: flatnode.h:70
FLATNODE_HD DataT QueryValue() const
Definition: flatnode.h:53
static FLATNODE_HD SparseTreeNode CreateLeafNode(IdxT instance_count)
Definition: flatnode.h:65
FLATNODE_HD DataT BestMetric() const
Definition: flatnode.h:54
FLATNODE_HD int64_t RightChildId() const
Definition: flatnode.h:56
FLATNODE_HD bool IsLeaf() const
Definition: flatnode.h:69
FLATNODE_HD IdxT ColumnId() const
Definition: flatnode.h:52
FLATNODE_HD IdxT InstanceCount() const
Definition: flatnode.h:57