Java Matrix Swap swapRows(double[][] matrix, int i1, int i2)

Here you can find the source of swapRows(double[][] matrix, int i1, int i2)

Description

Swaps two rows of a matrix.

License

Open Source License

Parameter

Parameter Description
matrix the matrix
i1 index of the first row
i2 index of the second row

Declaration

public static void swapRows(double[][] matrix, int i1, int i2) 

Method Source Code

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

public class Main {
    /**/*  w ww.j av a  2 s.  c o m*/
     * Swaps two rows of a matrix.
     * @param matrix the matrix
     * @param i1 index of the first row
     * @param i2 index of the second row
     */
    public static void swapRows(double[][] matrix, int i1, int i2) {
        double[] row1 = matrix[i1];
        matrix[i1] = matrix[i2];
        matrix[i2] = row1;
    }
}

Related

  1. swapColumns(byte[][] matrix, int a, int b)
  2. swapColumns(double[][] front, int colA, int colB)
  3. swapColumns(int i, int j, boolean[][] matrix)
  4. swapRows(double[][] a, int i, int j)
  5. swapRows(double[][] Ab, int k, int i)
  6. swapShorts(byte bs[][])
  7. swapTwoBlocks(int[][] pattern, int block1, int block2)
  8. swapTwoRows(byte[][] pattern, int row1, int row2)