| 113 | } |
| 114 | |
| 115 | string 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 | |
| 127 | string sparse_vector__repr__ (const std::vector<std::pair<unsigned long,double> >& v) |
| 128 | { |
no test coverage detected