Java Array Invert invertOrder(double[] values)

Here you can find the source of invertOrder(double[] values)

Description

Inverts the order of the values in an array of doubles.

License

Open Source License

Declaration

public static void invertOrder(double[] values) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//ww  w  .  j  a v  a  2s  . co  m
     * Inverts the order of the values in an array of doubles.
     * The passed array is altered.
     */
    public static void invertOrder(double[] values) {
        // invert order of values
        final int length = values.length;
        final int halfLength = length / 2;
        for (int i = 0; i < halfLength; i++) {
            final double temp = values[i];
            values[i] = values[length - i - 1];
            values[length - i - 1] = temp;
        }
    }
}

Related

  1. invertI(long[] v)
  2. invertirTabla2(int[] tabla)
  3. invertList(int[] pos)
  4. invertMap(int[] map)
  5. invertMapping(int[] mapping)
  6. invertOrientation(int[] face)
  7. invertValues(double[] vector)
  8. InvertVector(int v[])