MCPcopy Create free account
hub / github.com/douchuan/algorithm / to_string

Method to_string

src/math/sparse_vector.rs:115–122  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

113
114impl ToString for SparseVector {
115 fn to_string(&self) -> String {
116 let keys = self.st.keys();
117 let mut v = Vec::with_capacity(keys.len());
118 for &i in keys {
119 v.push(format!("({}, {})", i, self.get(i)));
120 }
121 v.join("")
122 }
123}
124
125impl Clone for SparseVector {

Callers

nothing calls this directly

Calls 3

pushMethod · 0.80
keysMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected