Here you can find the source of clone_multidim_array(float[][] arr)
Parameter | Description |
---|---|
arr | a parameter |
public static float[][] clone_multidim_array(float[][] arr)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 Jay Unruh, Stowers Institute for Medical Research. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v2.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html ******************************************************************************/ public class Main { /******************* * copies a 2D float array//from ww w. java 2 s . c om * @param arr * @return */ public static float[][] clone_multidim_array(float[][] arr) { float[][] temp = new float[arr.length][]; for (int i = 0; i < arr.length; i++) { temp[i] = arr[i].clone(); } return temp; } /******************* * copies a 2D int array * @param arr * @return */ public static int[][] clone_multidim_array(int[][] arr) { int[][] temp = new int[arr.length][]; for (int i = 0; i < arr.length; i++) { temp[i] = arr[i].clone(); } return temp; } /************************ * copies a 2D short array * @param arr * @return */ public static short[][] clone_multidim_array(short[][] arr) { short[][] temp = new short[arr.length][]; for (int i = 0; i < arr.length; i++) { temp[i] = arr[i].clone(); } return temp; } /************************ * copies a 2D byte array * @param arr * @return */ public static byte[][] clone_multidim_array(byte[][] arr) { byte[][] temp = new byte[arr.length][]; for (int i = 0; i < arr.length; i++) { temp[i] = arr[i].clone(); } return temp; } }