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

Method CopyTo

src/treelearner/split_info.hpp:57–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55 }
56
57 inline void CopyTo(char* buffer) const {
58 std::memcpy(buffer, &feature, sizeof(feature));
59 buffer += sizeof(feature);
60 std::memcpy(buffer, &left_count, sizeof(left_count));
61 buffer += sizeof(left_count);
62 std::memcpy(buffer, &right_count, sizeof(right_count));
63 buffer += sizeof(right_count);
64 std::memcpy(buffer, &gain, sizeof(gain));
65 buffer += sizeof(gain);
66 std::memcpy(buffer, &threshold, sizeof(threshold));
67 buffer += sizeof(threshold);
68 std::memcpy(buffer, &left_output, sizeof(left_output));
69 buffer += sizeof(left_output);
70 std::memcpy(buffer, &right_output, sizeof(right_output));
71 buffer += sizeof(right_output);
72 std::memcpy(buffer, &left_sum_gradient, sizeof(left_sum_gradient));
73 buffer += sizeof(left_sum_gradient);
74 std::memcpy(buffer, &left_sum_hessian, sizeof(left_sum_hessian));
75 buffer += sizeof(left_sum_hessian);
76 std::memcpy(buffer, &right_sum_gradient, sizeof(right_sum_gradient));
77 buffer += sizeof(right_sum_gradient);
78 std::memcpy(buffer, &right_sum_hessian, sizeof(right_sum_hessian));
79 buffer += sizeof(right_sum_hessian);
80 std::memcpy(buffer, &default_left, sizeof(default_left));
81 buffer += sizeof(default_left);
82 std::memcpy(buffer, &monotone_type, sizeof(monotone_type));
83 buffer += sizeof(monotone_type);
84 std::memcpy(buffer, &min_constraint, sizeof(min_constraint));
85 buffer += sizeof(min_constraint);
86 std::memcpy(buffer, &max_constraint, sizeof(max_constraint));
87 buffer += sizeof(max_constraint);
88 std::memcpy(buffer, &num_cat_threshold, sizeof(num_cat_threshold));
89 buffer += sizeof(num_cat_threshold);
90 std::memcpy(buffer, cat_threshold.data(), sizeof(uint32_t) * num_cat_threshold);
91 }
92
93 void CopyFrom(const char* buffer) {
94 std::memcpy(&feature, buffer, sizeof(feature));

Callers 1

SyncUpGlobalBestSplitFunction · 0.45

Calls 1

dataMethod · 0.80

Tested by

no test coverage detected