| 500 | |
| 501 | template<class Ty> |
| 502 | SparseQVector<Ty> SparseQMatrix<Ty>::getRowSparseQVector(unsigned long x) { |
| 503 | SparseQVector<Ty> SpV; |
| 504 | int nnz_num = nnzcol_ptr[x + 1] - nnzcol_ptr[x]; |
| 505 | SpV.SetNNZ(nnz_num); |
| 506 | int count = 0; |
| 507 | for (int i = nnzcol_ptr[x]; i < nnzcol_ptr[x + 1]; i++) { |
| 508 | SpV.insert(nnzcol_ind[i], data[i], count); |
| 509 | count++; |
| 510 | } |
| 511 | return SpV; |
| 512 | } |
| 513 | |
| 514 | template<class Ty> |
| 515 | vector<vector<pair<Ty, size_t>>> Transfer2Triplet(SparseQMatrix<Ty>& M) { |