Reverses all bits in the array.
439837
public void reverse() {
    int[] newBits = new int[bits.length];
    // reverse all int's first
    int len = (size - 1) / 32;
    int oldBitsLen = len + 1;
    for (int i = 0; i < oldBitsLen; i++) {
      long x = bits[i];
      x = ((x >>  1) & 0x55555555L) | ((x & 0x55555555L) <<  1);
      x = ((x >>  2) & 0x33333333L) | ((x & 0x33333333L) <<  2);
      x = ((x >>  4) & 0x0f0f0f0fL) | ((x & 0x0f0f0f0fL) <<  4);
      x = ((x >>  8) & 0x00ff00ffL) | ((x & 0x00ff00ffL) <<  8);
      x = ((x >> 16) & 0x0000ffffL) | ((x & 0x0000ffffL) << 16);
      newBits[len - i] = (int) x;
    }
    // now correct the int's if the bit size isn't a multiple of 32
    if (size != oldBitsLen * 32) {
      int leftOffset = oldBitsLen * 32 - size;
      int currentInt = newBits[0] >>> leftOffset;
      for (int i = 1; i < oldBitsLen; i++) {
        int nextInt = newBits[i];
        currentInt |= nextInt << (32 - leftOffset);
        newBits[i - 1] = currentInt;
        currentInt = nextInt >>> leftOffset;
      }
      newBits[oldBitsLen - 1] = currentInt;
    }
    bits = newBits;
  }
533380
function reverse (arr) {
  const reversedArray = [];
  for (let i = arr.length - 1; i >= 0; i--) {
    reversedArray.push(arr[i]);
  }
  return reversedArray;
}
923601
def unsort(self, array):
        
        if self.sorted:
            inverse = sorted(enumerate(self.indices), key=itemgetter(1))
            array = [array[i[0]] for i in inverse]
        return array
354678
public static double[] reverse(final double[] array, final int startIndexInclusive, final int endIndexExclusive) {
		if (isEmpty(array)) {
			return array;
		}
		int i = startIndexInclusive < 0 ? 0 : startIndexInclusive;
		int j = Math.min(array.length, endIndexExclusive) - 1;
		double tmp;
		while (j > i) {
			tmp = array[j];
			array[j] = array[i];
			array[i] = tmp;
			j--;
			i++;
		}
		return array;
	}
1014984
public static <T> T[] reverseArray(T[] arr) {
		for (int left = 0, right = arr.length - 1; left < right; left++, right--) {
			T temp = arr[left];
			arr[left] = arr[right];
			arr[right] = temp;
		}
		return arr;
	}
35332
public void reverse() {
		for (int i = 0; i < size / 2; i++) {
			T tmp = data[i];
			data[i] = data[size - i - 1];
			data[size - i - 1] = tmp;
		}
	}
327543
public void reverse() {
	// overridden for performance only.
	double tmp;
	int limit=size/2;
	int j=size-1;

	double[] theElements = elements;
	for (int i=0; i<limit;) { //swap
		tmp=theElements[i];
		theElements[i++]=theElements[j];
		theElements[j--]=tmp;
	}
}
1058045
private static void reverse(int[] path, int i, int j) {
        while (i < j) {
            int tmp = path[i];
            path[i] = path[j];
            path[j] = tmp;
            i++;
            j--;
        }
    }
1329600
public function reverse(){
		
		if($this->_ReadOnly){
			throw new ReadOnlyException(\get_called_class() . ' is read only');
		}
		
		$this->_Arr = \array_reverse($this->_Arr);
		
		return $this;
		
	}
373185
def reverse_byte_nibbles!
    w = ""
    w.force_encoding("BINARY") if w.respond_to?(:force_encoding)
    @bytes.each_byte do |b|
      w << ((b >> 4)|((b&0xF)<<4))
    end
    @bytes = w
    __setobj__ @bytes
    self
  end
409218
function reverse (arrayLike) {
    var len = _toArrayLength(arrayLike.length);
    var result = Array(len);

    for (var i = 0, ofs = len - 1; i < len; i++) {
        result[i] = arrayLike[ofs - i];
    }

    return result;
}
821064
def Reverse(self, y):
        """"""
        return self._Bisect(y, self.ys, self.xs)
930309
public static byte[] reverseByteArray(byte[] inputByteArray) {
	byte[] result=new byte[inputByteArray.length];
	for (int i=inputByteArray.length-1;i>=0;i--) {
		result[result.length-1-i]=inputByteArray[i];
	}
	return result;
}
846632
function reverse(input) {

  if(isString(input)) {
    return input.split('').reverse().join('');
  }

  return (isArray(input))
    ? input.slice().reverse()
    : input;
}
1459
long[] toLongArray() {
		// create array through an aligned copy
		BitVector copy = alignedCopy();
		long[] longs = copy.bits;
		int length = longs.length;
		if (length == 0) return longs;
		// reverse the array
		for (int i = 0, mid = length >> 1, j = length - 1; i < mid; i++, j--) {
			long t = longs[i];
			longs[i] = longs[j];
			longs[j] = t;
		}
		// mask off top bits in case copy was produced via clone
		final long mask = -1L >>> (ADDRESS_SIZE - copy.finish & ADDRESS_MASK);
		longs[0] &= mask;
		// return the result
		return longs;
	}
1367779
public function revert()
    {
        $this->order = $this->order == 'ASC' ? 'DESC' : 'ASC';
        $this->index = array_reverse($this->index);

        // revert order in all sub-sets
        foreach ($this->sets as $set) {
            if ($this->order != $set->get_parameters('ORDER')) {
                $set->revert();
            }
        }
    }
1312264
private static double[] reversed(double[] a) {
    // TODO: there doesn't appear to be a nicer version in Java, unfortunately.
    Arrays.sort(a);
    for(int i = 0, j = a.length - 1; i < j; i++, j--) {
      double tmp = a[i];
      a[i] = a[j];
      a[j] = tmp;
    }
    return a;
  }