| 265 | } |
| 266 | |
| 267 | VectorXd MproductbDen(const SparseQMatrix<double>& M, const VectorXd &b) { |
| 268 | int size = M.size; |
| 269 | VectorXd Mb(size); |
| 270 | auto data = M.data; |
| 271 | auto col_ptr = M.nnzcol_ptr; |
| 272 | auto col_ind = M.nnzcol_ind; |
| 273 | if (size == 0) { |
| 274 | cout << "wrong is here" << endl; |
| 275 | } |
| 276 | #pragma omp parallel for |
| 277 | for (int i = 0; i < size; i++) { |
| 278 | double sum = 0; |
| 279 | for (int j = col_ptr[i]; j < col_ptr[i + 1]; j++) { |
| 280 | auto temp = data[j] * b(col_ind[j]); |
| 281 | sum += temp; |
| 282 | } |
| 283 | Mb(i) = sum; |
| 284 | } |
| 285 | |
| 286 | return Mb; |
| 287 | } |
| 288 | |
| 289 | vector<double> MproductbDen(const SparseQMatrix<double>& M, const vector<double>& b) { |
| 290 | int size = M.size; |
no outgoing calls
no test coverage detected