GrxCopyUtil.java
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
00003  * All rights reserved. This program is made available under the terms of the
00004  * Eclipse Public License v1.0 which accompanies this distribution, and is
00005  * available at http://www.eclipse.org/legal/epl-v10.html
00006  * Contributors:
00007  * General Robotix Inc.
00008  * National Institute of Advanced Industrial Science and Technology (AIST) 
00009  */
00018 package com.generalrobotix.ui.util;
00019 
00020 import java.lang.System;
00021 
00022 public class GrxCopyUtil {
00023     public static int[][] copyIntWDim(int[][] src ){
00024         int [][] ret = new int[src.length][];
00025         for(int i = 0; i < src.length; ++i){
00026             ret[i] = new  int[src[i].length];
00027             GrxCopyUtil.copyDim(src[i], ret[i], src[i].length);
00028         }
00029         return ret;
00030     }
00031 
00032     public static long[][] copyLongWDim(long[][] src ){
00033         long [][] ret = new long[src.length][];
00034         for(int i = 0; i < src.length; ++i){
00035             ret[i] = new  long[src[i].length];
00036             GrxCopyUtil.copyDim(src[i], ret[i], src[i].length);
00037         }
00038         return ret;
00039     }
00040     
00041     public static double[][] copyDoubleWDim(double[][] src ){
00042         double [][] ret = new double[src.length][];
00043         for(int i = 0; i < src.length; ++i){
00044             ret[i] = new  double[src[i].length];
00045             GrxCopyUtil.copyDim(src[i], ret[i], src[i].length);
00046         }
00047         return ret;
00048     }
00049     
00050     public static float[][] copyFloatWDim(float[][] src ){
00051         float [][] ret = new float[src.length][];
00052         for(int i = 0; i < src.length; ++i){
00053             ret[i] = new  float[src[i].length];
00054             GrxCopyUtil.copyDim(src[i], ret[i], src[i].length);
00055         }
00056         return ret;
00057     }
00058     
00059     public static <T> void copyDim(T src, T dest, int length){
00060         System.arraycopy(src, 0, dest, 0, length);
00061     }
00062 }


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sun Apr 2 2017 03:43:53