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

Function StringToArray

include/LightGBM/utils/common.h:482–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480
481template<typename T>
482inline static std::vector<T> StringToArray(const std::string& str, char delimiter) {
483 std::vector<std::string> strs = Split(str.c_str(), delimiter);
484 std::vector<T> ret;
485 ret.reserve(strs.size());
486 __StringToTHelper<T, std::is_floating_point<T>::value> helper;
487 for (const auto& s : strs) {
488 ret.push_back(helper(s));
489 }
490 return ret;
491}
492
493template<typename T>
494inline static std::vector<T> StringToArray(const std::string& str, int n) {

Callers

nothing calls this directly

Calls 4

push_backMethod · 0.80
SplitFunction · 0.70
reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected