MCPcopy Create free account
hub / github.com/OriginQ/QPanda-2 / getRowSparseQVector

Method getRowSparseQVector

Applications/HHL_Algorithm/SparseQMatrix.h:502–512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500
501template<class Ty>
502SparseQVector<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
514template<class Ty>
515vector<vector<pair<Ty, size_t>>> Transfer2Triplet(SparseQMatrix<Ty>& M) {

Callers

nothing calls this directly

Calls 2

SetNNZMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected