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

Method get_cbit_by_addr

Core/QuantumMachine/OriginClassicalSystem.cpp:77–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77CBit* OriginCMem::get_cbit_by_addr(size_t caddr)
78{
79 std::string str_cbit = "c" + to_string(caddr);
80 for (auto iter = vecBit.begin(); iter != vecBit.end(); ++iter)
81 {
82 if (str_cbit == (*iter)->getName() && (*iter)->getOccupancy())
83 return CBitFactory::GetFactoryInstance().CreateCBitFromName(str_cbit);
84 }
85
86 QCERR("get cbit by address error");
87 throw invalid_argument("get cbit by address error");
88}
89
90CBit *OriginCMem::Allocate_CBit()
91{

Callers 3

MeasureMethod · 0.80
runWithConfigurationMethod · 0.80
runWithConfigurationMethod · 0.80

Calls 5

CreateCBitFromNameMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getNameMethod · 0.45
getOccupancyMethod · 0.45

Tested by

no test coverage detected