MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / getRandomInt

Function getRandomInt

tests/utils/random.cpp:90–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88
89
90int getRandomInt(int min, int maxExcl) {
91 DEMAND( maxExcl >= min );
92
93 // permit this out of convenience
94 // for some test generators
95 if (min == maxExcl)
96 return min;
97
98 qreal r = std::floor(getRandomReal(min, maxExcl));
99 int out = static_cast<int>(r);
100
101 DEMAND( out >= min );
102 DEMAND( out < maxExcl );
103 return out;
104}
105
106
107qcomp getRandomComplex() {

Callers 12

getRandomIntsFunction · 0.70
getRandomPauliStrFunction · 0.70
getRandomDiagPauliStrFunction · 0.70
SECTIONFunction · 0.50
SECTIONFunction · 0.50
SECTIONFunction · 0.50
SECTIONFunction · 0.50
SECTIONFunction · 0.50
SECTIONFunction · 0.50
SECTIONFunction · 0.50

Calls 1

getRandomRealFunction · 0.70

Tested by

no test coverage detected