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

Function getRandomReal

tests/deprecated/test_utilities.cpp:535–543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

533}
534
535qreal getRandomReal(qreal min, qreal max) {
536 DEMAND( min <= max );
537 qreal r = min + (max - min) * (rand() / (qreal) RAND_MAX);
538
539 // check bounds satisfied
540 DEMAND( r >= min );
541 DEMAND( r <= max );
542 return r;
543}
544
545qcomp getRandomComplex() {
546 return getRandomReal(-1,1) + getRandomReal(-1,1) * (qcomp) 1i;

Callers 10

test_unitaries.cppFile · 0.70
getRandomComplexFunction · 0.70
getRandomProbabilitiesFunction · 0.70
getRandomIntFunction · 0.70
getRandomDiagonalUnitaryFunction · 0.70
getRandomKrausMapFunction · 0.70
setRandomPauliSumFunction · 0.70
setRandomDiagPauliHamilFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected