MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / CopyFrom

Method CopyFrom

src/treelearner/split_info.hpp:93–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91 }
92
93 void CopyFrom(const char* buffer) {
94 std::memcpy(&feature, buffer, sizeof(feature));
95 buffer += sizeof(feature);
96 std::memcpy(&left_count, buffer, sizeof(left_count));
97 buffer += sizeof(left_count);
98 std::memcpy(&right_count, buffer, sizeof(right_count));
99 buffer += sizeof(right_count);
100 std::memcpy(&gain, buffer, sizeof(gain));
101 buffer += sizeof(gain);
102 std::memcpy(&threshold, buffer, sizeof(threshold));
103 buffer += sizeof(threshold);
104 std::memcpy(&left_output, buffer, sizeof(left_output));
105 buffer += sizeof(left_output);
106 std::memcpy(&right_output, buffer, sizeof(right_output));
107 buffer += sizeof(right_output);
108 std::memcpy(&left_sum_gradient, buffer, sizeof(left_sum_gradient));
109 buffer += sizeof(left_sum_gradient);
110 std::memcpy(&left_sum_hessian, buffer, sizeof(left_sum_hessian));
111 buffer += sizeof(left_sum_hessian);
112 std::memcpy(&right_sum_gradient, buffer, sizeof(right_sum_gradient));
113 buffer += sizeof(right_sum_gradient);
114 std::memcpy(&right_sum_hessian, buffer, sizeof(right_sum_hessian));
115 buffer += sizeof(right_sum_hessian);
116 std::memcpy(&default_left, buffer, sizeof(default_left));
117 buffer += sizeof(default_left);
118 std::memcpy(&monotone_type, buffer, sizeof(monotone_type));
119 buffer += sizeof(monotone_type);
120 std::memcpy(&min_constraint, buffer, sizeof(min_constraint));
121 buffer += sizeof(min_constraint);
122 std::memcpy(&max_constraint, buffer, sizeof(max_constraint));
123 buffer += sizeof(max_constraint);
124 std::memcpy(&num_cat_threshold, buffer, sizeof(num_cat_threshold));
125 buffer += sizeof(num_cat_threshold);
126 cat_threshold.resize(num_cat_threshold);
127 std::memcpy(cat_threshold.data(), buffer, sizeof(uint32_t) * num_cat_threshold);
128 }
129
130 inline void Reset() {
131 // initialize with -1 and -inf gain

Callers 2

SyncUpGlobalBestSplitFunction · 0.45
FindBestSplitsMethod · 0.45

Calls 2

dataMethod · 0.80
resizeMethod · 0.45

Tested by

no test coverage detected