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

Method getSparseEigenColVector

Applications/HHL_Algorithm/SparseQMatrix.h:399–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397
398template<class Ty>
399Eigen::Matrix<Ty, Dynamic, 1> SparseQMatrix<Ty>::getSparseEigenColVector(unsigned long x) {
400 //vector<Ty> col_vector(size, 0);
401 Eigen::Matrix<Ty, Dynamic, 1> col_vector = Eigen::Matrix<Ty, Dynamic, 1>::Zero(size, 1);
402 for (int i = 0; i < size; i++) {
403 for (int j = nnzcol_ptr[i]; j < nnzcol_ptr[i + 1]; j++) {
404 if (x == nnzcol_ind[j]) {
405 col_vector(i) = data[j];
406 break;
407 }
408 }
409 }
410 return col_vector;
411}
412
413template<class Ty>
414Eigen::Matrix<Ty, Dynamic, 1> SparseQMatrix<Ty>::getCompressedEigenColVector(unsigned long x) {

Callers 2

getRhoJFunction · 0.80
MprodcutAFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected