Returns the scalar-vector product of this vector with the specified scalar.
(&self, alpha: f64)
| 79 | |
| 80 | /// Returns the scalar-vector product of this vector with the specified scalar. |
| 81 | pub fn scale(&self, alpha: f64) -> Self { |
| 82 | let mut c = Self::new(self.d); |
| 83 | for &i in self.st.keys() { |
| 84 | c.put(i, alpha * self.get(i)); |
| 85 | } |
| 86 | c |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | impl Add for SparseVector { |