Java Array Swap swap(double[] data, int i, int j)

Here you can find the source of swap(double[] data, int i, int j)

Description

swap

License

Open Source License

Declaration

static public void swap(double[] data, int i, int j) 

Method Source Code

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

public class Main {
    static public void swap(double[] data, int i, int j) {
        double tmp = data[i];
        data[i] = data[j];/*  www. j a v a2s . co m*/
        data[j] = tmp;
    }

    static public void swap(double[][] data, int i1, int j1, int i2, int j2) {
        double tmp = data[i1][j1];
        data[i1][j1] = data[i2][j2];
        data[i2][j2] = tmp;
    }
}

Related

  1. swap(byte[] rv, int offsetA, int offsetB)
  2. swap(Comparable[] a, int oldIndex, int newIndex)
  3. swap(double x[], Object[] corr, int a, int b)
  4. swap(double[] a, int i, int j)
  5. swap(double[] array, int i, int j)
  6. swap(final byte[] array, int firstIndex, int secondIndex)
  7. swap(final byte[] src)
  8. swap(final float[] pVertices, final int pVertexStride, final int pVertexIndexA, final int pVertexIndexB)
  9. swap(final int a[], final int i, final int j)