Sets the ith coordinate of this vector to the specified value.
(&mut self, i: usize, v: f64)
| 26 | |
| 27 | /// Sets the ith coordinate of this vector to the specified value. |
| 28 | pub fn put(&mut self, i: usize, v: f64) { |
| 29 | if v == 0.0 { |
| 30 | self.st.delete(&i); |
| 31 | } else { |
| 32 | self.st.insert(i, v); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | /// Returns the ith coordinate of this vector |
| 37 | pub fn get(&self, i: usize) -> f64 { |