Reverses the passed in matrix such that m[0] becomes m[m.length - 1] etc

@param reverse the matrix to reverse
@return the reversed matrix
776115
@Override
    public INDArray rot(INDArray reverse) {
        INDArray ret = Nd4j.create(reverse.shape());
        if (reverse.isVector())
            return reverse(reverse);
        else {
            for (int i = 0; i < reverse.slices(); i++) {
                ret.putSlice(i, reverse(reverse.slice(i)));
            }
        }
        return ret.reshape(reverse.shape());
    }
1248090
public static void reverse(byte[] bytes) {
    for (int i = 0; i < bytes.length / 2; i++) {
      byte temp = bytes[i];
      bytes[i] = bytes[bytes.length - 1 - i];
      bytes[bytes.length - 1 - i] = temp;
    }
  }
463056
public static void reverse(final char[] a, int fromIndex, int toIndex) {
        checkFromToIndex(fromIndex, toIndex, len(a));

        if (N.isNullOrEmpty(a) || a.length == 1) {
            return;
        }

        char tmp = 0;

        for (int i = fromIndex, j = toIndex - 1; i < j; i++, j--) {
            tmp = a[i];
            a[i] = a[j];
            a[j] = tmp;
        }
    }
173764
private static int[] inverse(int[] perm) {
        int[] inv = new int[perm.length];
        for (int i = 0, len = perm.length; i < len; i++)
            inv[perm[i]] = i;
        return inv;
    }
318136
public static <T> List<T> reverse(List<T> list) {
		Collections.reverse(list);
		return list;
	}
478086
public static void reverseCantor(long cantor, long[] result) {
        if (result == null || result.length < 2) {
            result = new long[2];
        }
        // reverse Cantor Function
        long w = (long) (Math.floor(Math.sqrt(8 * cantor + 1) - 1) / 2);
        long t = (w * w + w) / 2;

        long k2 = cantor - t;
        long k1 = w - k2;
        result[0] = k1;
        result[1] = k2;
    }
885229
public static void reverse(int[] a) {
        int i = 0, j = a.length - 1;
        while (i < j) {
            SortUtils.swap(a, i++, j--);  // code for swap not shown, but easy enough
        }
    }
184565
private static void reverse(int first, int last, Swapper swapper) {
	// no more needed since manually inlined
	while (first < --last) {
		swapper.swap(first++,last);
	}
}
578651
public static MutableFst reverse(Fst infst) {
    infst.throwIfInvalid();

    MutableFst fst = ExtendFinal.apply(infst);

    Semiring semiring = fst.getSemiring();

    MutableFst result = new MutableFst(fst.getStateCount(), semiring);
    result.setInputSymbolsAsCopy(fst.getInputSymbols());
    result.setOutputSymbolsAsCopy(fst.getOutputSymbols());
    MutableState[] stateMap = initStateMap(fst, semiring, result);

    for (int i = 0; i < fst.getStateCount(); i++) {
      State oldState = fst.getState(i);
      MutableState newState = stateMap[oldState.getId()];
      for (int j = 0; j < oldState.getArcCount(); j++) {
        Arc oldArc = oldState.getArc(j);
        MutableState newNextState = stateMap[oldArc.getNextState().getId()];
        double newWeight = semiring.reverse(oldArc.getWeight());
        result.addArc(newNextState, oldArc.getIlabel(), oldArc.getOlabel(), newState, newWeight);
      }
    }
    return result;
  }
812627
function reverse(a) {
  var len = a.length;
  for (var i = 0; i < Math.floor(len/2); i++) {
    [a[i], a[len-i-1]] = [a[len-i-1], a[i]];
  }
  return a;
}
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--;
        }
    }
712505
@Override
    public boolean invert() {
        double determinant = determinant();
        if (determinant == 0) {
            return false;
        }

        // first row
        double t00 =  determinant3x3(m11, m12, m13, m21, m22, m23, m31, m32, m33);
        double t01 = -determinant3x3(m10, m12, m13, m20, m22, m23, m30, m32, m33);
        double t02 =  determinant3x3(m10, m11, m13, m20, m21, m23, m30, m31, m33);
        double t03 = -determinant3x3(m10, m11, m12, m20, m21, m22, m30, m31, m32);

        // second row
        double t10 = -determinant3x3(m01, m02, m03, m21, m22, m23, m31, m32, m33);
        double t11 =  determinant3x3(m00, m02, m03, m20, m22, m23, m30, m32, m33);
        double t12 = -determinant3x3(m00, m01, m03, m20, m21, m23, m30, m31, m33);
        double t13 =  determinant3x3(m00, m01, m02, m20, m21, m22, m30, m31, m32);

        // third row
        double t20 =  determinant3x3(m01, m02, m03, m11, m12, m13, m31, m32, m33);
        double t21 = -determinant3x3(m00, m02, m03, m10, m12, m13, m30, m32, m33);
        double t22 =  determinant3x3(m00, m01, m03, m10, m11, m13, m30, m31, m33);
        double t23 = -determinant3x3(m00, m01, m02, m10, m11, m12, m30, m31, m32);

        // fourth row
        double t30 = -determinant3x3(m01, m02, m03, m11, m12, m13, m21, m22, m23);
        double t31 =  determinant3x3(m00, m02, m03, m10, m12, m13, m20, m22, m23);
        double t32 = -determinant3x3(m00, m01, m03, m10, m11, m13, m20, m21, m23);
        double t33 =  determinant3x3(m00, m01, m02, m10, m11, m12, m20, m21, m22);

        // transpose and divide by the determinant
        m00 = t00 / determinant;
        m01 = t10 / determinant;
        m02 = t20 / determinant;
        m03 = t30 / determinant;

        m10 = t01 / determinant;
        m11 = t11 / determinant;
        m12 = t21 / determinant;
        m13 = t31 / determinant;

        m20 = t02 / determinant;
        m21 = t12 / determinant;
        m22 = t22 / determinant;
        m23 = t32 / determinant;

        m30 = t03 / determinant;
        m31 = t13 / determinant;
        m32 = t23 / determinant;
        m33 = t33 / determinant;

        return true;
    }
840715
private static String reverseString(String in) {
        StringBuilder out = new StringBuilder(in).reverse();
        return out.toString();
    }
966062
public static byte[] reverse(byte[] data) {
        for (int i = 0, j = data.length - 1; i < data.length / 2; i++, j--) {
            data[i] ^= data[j];
            data[j] ^= data[i];
            data[i] ^= data[j];
        }
        return data;
    }
397278
private static void reverse(final byte[] arr, final int len) {
        for (int l = 0, r = 0 + len - 1; l < r; l++, r--) {
            final byte tmp = arr[l];
            arr[l] = arr[r];
            arr[r] = tmp;
        }
    }
1043572
private static CharSequence reverse(CharSequence s) {
    int length = s.length();
    if (length <= 1) {
      return s;
    }

    char[] buffer = new char[length];
    buffer[0] = s.charAt(length - 1);

    for (int i = 1; i < length; i++) {
      buffer[i] = s.charAt(length - 1 - i);
      if (Character.isSurrogatePair(buffer[i], buffer[i - 1])) {
        swap(buffer, i - 1, i);
      }
    }

    return new String(buffer);
  }
646511
void reverse( Grid g ) {
		work.clear();
		int N = g.rows*g.columns;
		for (int i = 0; i < N; i++) {
			work.add( g.ellipses.get(N-i-1));
		}

		g.ellipses.clear();
		g.ellipses.addAll(work);
	}