集册 Java实例教程 此实用程序函数将传递的二维双数组的特定列的副本作为一维双数组返回。

此实用程序函数将传递的二维双数组的特定列的副本作为一维双数组返回。

欢马劈雪     最近更新时间:2020-01-02 10:19:05

433
此实用程序函数将传递的二维双数组的特定列的副本作为一维双数组返回。
/** nowjava - 时代Java 提 供 **/


//package com.nowjava;


public class Main {

    /**

     * This utility function returns a copy of the specific column of a passed

     * 2D double array as a one dimensional double array.

     * 

     * @param twoDfloatArray

     *            a 2D double array whose column is supposed to be fetched and

     *            return

     * @param colNb

     *            the number of column whose values are supposed to be returned

     *            as array

     * @return an array (double) containing a copy of the passed column number

     *         and 2D array

     */

    public static double[] colCopy(double[][] twoDdoubleArray, int colNb) {

        double[] aCol = new double[twoDdoubleArray.length];

        
展开阅读全文