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

Function ArrayToString

include/LightGBM/utils/common.h:449–463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447}
448
449inline static std::string ArrayToString(const std::vector<double>& arr, size_t n) {
450 if (arr.empty() || n == 0) {
451 return std::string("");
452 }
453 const size_t buf_len = 32;
454 std::vector<char> buffer(buf_len);
455 std::stringstream str_buf;
456 DoubleToStr(arr[0], buffer.data(), buf_len);
457 str_buf << buffer.data();
458 for (size_t i = 1; i < std::min(n, arr.size()); ++i) {
459 DoubleToStr(arr[i], buffer.data(), buf_len);
460 str_buf << ' ' << buffer.data();
461 }
462 return str_buf.str();
463}
464
465template<typename T, bool is_float>
466struct __StringToTHelper {

Callers 1

ToStringMethod · 0.50

Calls 4

dataMethod · 0.80
DoubleToStrFunction · 0.70
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected