MCPcopy Create free account
hub / github.com/davisking/dlib / sparse_vector__str__

Function sparse_vector__str__

tools/python/src/basic.cpp:115–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115string sparse_vector__str__ (const std::vector<std::pair<unsigned long,double> >& v)
116{
117 std::ostringstream sout;
118 for (unsigned long i = 0; i < v.size(); ++i)
119 {
120 sout << v[i].first << ": " << v[i].second;
121 if (i+1 < v.size())
122 sout << "\n";
123 }
124 return sout.str();
125}
126
127string sparse_vector__repr__ (const std::vector<std::pair<unsigned long,double> >& v)
128{

Callers 1

sparse_vector__repr__Function · 0.85

Calls 2

sizeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected