ref_GF2 GF2X::operator[](long i) { if (i < 0) LogicError("GF2X: subscript out of range"); long wi = i/NTL_BITS_PER_LONG; if (wi >= xrep.length()) LogicError("GF2X: subscript out of range"); long bi = i - wi*NTL_BITS_PER_LONG; return ref_GF2(INIT_LOOP_HOLE, &xrep[wi], bi); }
ref_GF2 vec_GF2::operator[](long i) { vec_GF2& v = *this; if (i < 0 || i >= v.length()) LogicError("vec_GF2: subscript out of range"); long q = i/NTL_BITS_PER_LONG; long p = i - q*NTL_BITS_PER_LONG; return ref_GF2(INIT_LOOP_HOLE, &v.rep[q], p); }