| 244 | } |
| 245 | |
| 246 | SparseQMatrix<double> MprodcutA(SparseQMatrix<double>& M, SparseQMatrix<double>& A, int SparseIndex) { |
| 247 | int size = A.size; |
| 248 | |
| 249 | vector<vector<pair<int, double>>> sparse_dataM(size); |
| 250 | |
| 251 | #pragma omp for |
| 252 | for (int i = 0; i < size; i++) { |
| 253 | auto rowV = M.getSparseEigenRowVector(i); |
| 254 | for (int j = 0; j < size; j++) { |
| 255 | auto colV = A.getSparseEigenColVector(j); |
| 256 | auto val = rowV.dot(colV); |
| 257 | if (val != 0) { |
| 258 | sparse_dataM[i].emplace_back(j, val); |
| 259 | } |
| 260 | } |
| 261 | } |
| 262 | SparseQMatrix<double> MA; |
| 263 | FastTransfer2SparseQMat(sparse_dataM.data(), size, MA); |
| 264 | return MA; |
| 265 | } |
| 266 | |
| 267 | VectorXd MproductbDen(const SparseQMatrix<double>& M, const VectorXd &b) { |
| 268 | int size = M.size; |
no test coverage detected