Java Array Deep Copy deepArrayCopy(double[][] original)

Here you can find the source of deepArrayCopy(double[][] original)

Description

deep Array Copy

License

Open Source License

Declaration

public static double[][] deepArrayCopy(double[][] original) 

Method Source Code

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

import java.util.Arrays;

public class Main {
    public static double[][] deepArrayCopy(double[][] original) {
        /*double[][] copy = original.clone();
        for (int i = 0; i < copy.length; i++) 
        {/*w  ww.  j  a  v  a2s. c o m*/
            copy[i] = copy[i].clone();
        }*/

        double[][] copy = new double[original.length][original[0].length];

        for (int i = 0; i < copy.length; i++) {
            copy[i] = Arrays.copyOf(original[i], original[i].length);
        }

        return copy;
    }
}

Related

  1. deep_copy(int M[][])
  2. deepArrayCopy(double[][] original)
  3. deepArrayCopy(double[][] original)
  4. deepClone(double[][] ary)
  5. deepClone(int[][] source)
  6. deepCopy(byte[] org)
  7. deepCopy(double[][] in)