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

Method Allocate_CBit

Core/QuantumMachine/OriginClassicalSystem.cpp:90–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90CBit *OriginCMem::Allocate_CBit()
91{
92 for (auto iter = vecBit.begin(); iter!=vecBit.end(); ++iter)
93 {
94 if (!(*iter)->getOccupancy())
95 {
96 (*iter)->setOccupancy(true);
97 return *iter;
98 }
99 }
100 return nullptr;
101}
102
103CBit *OriginCMem::Allocate_CBit(size_t stCBitNum)
104{

Callers 3

TESTFunction · 0.80
allocateCBitMethod · 0.80
allocateCBitsMethod · 0.80

Calls 5

beginMethod · 0.45
endMethod · 0.45
getOccupancyMethod · 0.45
setOccupancyMethod · 0.45
getNameMethod · 0.45

Tested by 1

TESTFunction · 0.64