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

Function Split

include/LightGBM/utils/common.h:66–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66inline static std::vector<std::string> Split(const char* c_str, char delimiter) {
67 std::vector<std::string> ret;
68 std::string str(c_str);
69 size_t i = 0;
70 size_t pos = 0;
71 while (pos < str.length()) {
72 if (str[pos] == delimiter) {
73 if (i < pos) {
74 ret.push_back(str.substr(i, pos - i));
75 }
76 ++pos;
77 i = pos;
78 } else {
79 ++pos;
80 }
81 }
82 if (i < pos) {
83 ret.push_back(str.substr(i));
84 }
85 return ret;
86}
87
88inline static std::vector<std::string> SplitLines(const char* c_str) {
89 std::vector<std::string> ret;

Callers 15

StringToArrayFunction · 0.70
BinaryLoglossMethod · 0.50
MulticlassSoftmaxMethod · 0.50
MulticlassOVAMethod · 0.50
LoadModelFromStringMethod · 0.50
ParseMachineListMethod · 0.50
GetMembersFromStringMethod · 0.50
LoadInitialScoreMethod · 0.50
SplitMethod · 0.50
SplitCategoricalMethod · 0.50

Calls 3

lengthMethod · 0.80
push_backMethod · 0.80
substrMethod · 0.80

Tested by

no test coverage detected