void vec_GF2::swap(vec_GF2& y)
{
   long xf = fixed();
   long yf = y.fixed();

   if (xf != yf || (xf && length() != y.length()))
      LogicError("swap: can't swap these vec_GF2s");

   rep.swap(y.rep);
   _ntl_swap(_len, y._len);
   _ntl_swap(_maxlen, y._maxlen);
}
Beispiel #2
0
void WordVector::swap(WordVector& y)  
{  
   if ((this->rep && (this->rep[-2] & 1)) ||
       (y.rep && (y.rep[-2] & 1))) {
      CopySwap(*this, y);
      return;
   }

   _ntl_swap(this->rep, y.rep);
}