MCPcopy Create free account
hub / github.com/CoolProp/CoolProp / vec_to_string

Function vec_to_string

include/CoolProp/numerics/MatrixMath.h:319–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317///Templates for turning vectors (1D-matrices) into strings
318template <class T>
319std::string vec_to_string(const std::vector<T>& a, const char* fmt) {
320 if (a.size() < 1) return {""};
321 std::stringstream out;
322 out << "[ " << format(fmt, a[0]);
323 for (size_t j = 1; j < a.size(); j++) {
324 out << ", " << format(fmt, a[j]);
325 }
326 out << " ]";
327 return out.str();
328};
329template <class T>
330std::string vec_to_string(const std::vector<T>& a) {
331 return vec_to_string(std::vector<double>(a.begin(), a.end()), stdFmt);

Callers 15

extract_fractionsFunction · 0.85
_PropsSI_initializeFunction · 0.85
_PropsSI_outputsFunction · 0.85
_PropsSImultiFunction · 0.85
evaluateMethod · 0.85
solveMethod · 0.85
simplePolynomialMethod · 0.85
baseHornerMethod · 0.85
fracIntCentralMethod · 0.85
MatrixMath.cppFile · 0.85
updateMethod · 0.85
set_fractionsMethod · 0.85

Calls 2

formatFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected