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

Function setBit

quest/src/core/bitwise.hpp:108–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106
107
108INLINE qindex setBit(qindex number, int bitIndex, int bitValue) {
109
110 // beware that shifting the raw int would overflow (#623)
111 qindex bitInPlace = ((qindex) bitValue) << bitIndex;
112 qindex oneInPlace = QINDEX_ONE << bitIndex;
113 return (number & ~oneInPlace) | bitInPlace;
114}
115
116
117INLINE int getBitMaskParity(qindex mask) {

Callers 5

setBitsFunction · 0.70
getBitMaskFunction · 0.70
areQubitsUniqueFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected