Java Array Deep Copy deepCopyOf(double[][] src)

Here you can find the source of deepCopyOf(double[][] src)

Description

deep Copy Of

License

Open Source License

Declaration

static public double[][] deepCopyOf(double[][] src) 

Method Source Code


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

import java.util.Arrays;

public class Main {
    static public double[][] deepCopyOf(double[][] src) {
        if (src == null)
            return null;

        double[][] dst = new double[src.length][];
        for (int i = 0; i < src.length; i++)
            if (src[i] != null)
                dst[i] = Arrays.copyOf(src[i], src[i].length);

        return dst;
    }/*from w  ww  .  j a  v a2  s .co  m*/
}

Related

  1. deepCopy(final String s)
  2. deepCopy(int[] array)
  3. deepCopy(int[][] src, int[][] dest)
  4. deepCopy(Object objectArray)
  5. deepCopy2DArray(float[][] a)