Java Matrix Copy copyMatrix(boolean[][] matrix)

Here you can find the source of copyMatrix(boolean[][] matrix)

Description

copy Matrix

License

Open Source License

Declaration

public static boolean[][] copyMatrix(boolean[][] matrix) 

Method Source Code

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

public class Main {
    public static boolean[][] copyMatrix(boolean[][] matrix) {
        int maxY = matrix.length;
        int maxX = matrix[0].length;
        boolean[][] copy = new boolean[maxY][maxX];
        for (int y = 0; y < maxY; y++) {
            for (int x = 0; x < maxX; x++) {
                copy[y][x] = matrix[y][x];
            }//from   w  w w  .  j ava2  s . c o m
        }
        return copy;
    }
}

Related

  1. copyMatrix(boolean[][] old)
  2. copyMatrix(final double[][] c)
  3. copyMatrix(final double[][] src, final double[][] dest, int n)
  4. copyMatrix(final int rowsCount, final int columnsCount, final double[][] origMatrix)