Dot product of self by a vector *V* in sparse-dense to dense format *V* dense vector of shape (self.m,).
(self, V)
| 1227 | self.cols = np.asarray(cols, dtype=np.int32) |
| 1228 | |
| 1229 | def dot(self, V): |
| 1230 | """ |
| 1231 | Dot product of self by a vector *V* in sparse-dense to dense format |
| 1232 | *V* dense vector of shape (self.m,). |
| 1233 | """ |
| 1234 | assert V.shape == (self.m,) |
| 1235 | return np.bincount(self.rows, |
| 1236 | weights=self.vals*V[self.cols], |
| 1237 | minlength=self.m) |
| 1238 | |
| 1239 | def compress_csc(self): |
| 1240 | """ |
no outgoing calls