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

Method sub

src/math/sparse_vector.rs:105–111  ·  view source on GitHub ↗
(self, rhs: Self)

Source from the content-addressed store, hash-verified

103 type Output = Self;
104
105 fn sub(self, rhs: Self) -> Self::Output {
106 let mut c = self;
107 for &i in rhs.st.keys() {
108 c.put(i, c.get(i) - rhs.get(i));
109 }
110 c
111 }
112}
113
114impl ToString for SparseVector {

Callers

nothing calls this directly

Calls 3

keysMethod · 0.45
putMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected