MCPcopy Create free account
hub / github.com/devosoft/avida / SetBit

Method SetBit

avida-core/source/tools/cBitArray.h:156–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154 }
155
156 void SetBit(const int index, const bool value) {
157 const int field_id = GetField(index);
158 const int pos_id = GetFieldPos(index);
159 const int pos_mask = 1 << pos_id;
160
161 if (value == false) {
162 bit_fields[field_id] &= ~pos_mask;
163 } else {
164 bit_fields[field_id] |= pos_mask;
165 }
166 }
167
168 bool IsEqual(const cRawBitArray & in_array, int num_bits) const;
169

Callers 3

SetMethod · 0.80
mainFunction · 0.80
RunTestsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected