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

Method new

src/math/sparse_vector.rs:22–25  ·  view source on GitHub ↗

Initializes a d-dimensional zero vector.

(d: usize)

Source from the content-addressed store, hash-verified

20impl SparseVector {
21 /// Initializes a d-dimensional zero vector.
22 pub fn new(d: usize) -> Self {
23 let st = Tree::default();
24 Self { d, st }
25 }
26
27 /// Sets the ith coordinate of this vector to the specified value.
28 pub fn put(&mut self, i: usize, v: f64) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected