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

Method get

src/math/sparse_vector.rs:37–39  ·  view source on GitHub ↗

Returns the ith coordinate of this vector

(&self, i: usize)

Source from the content-addressed store, hash-verified

35
36 /// Returns the ith coordinate of this vector
37 pub fn get(&self, i: usize) -> f64 {
38 *self.st.get(&i).unwrap_or(&0.0)
39 }
40
41 /// Returns the number of nonzero entries in this vector.
42 pub fn nnz(&self) -> usize {

Callers 5

dotMethod · 0.45
scaleMethod · 0.45
addMethod · 0.45
subMethod · 0.45
cloneMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected