Java Matrix Copy copyMatrix(final double[][] c)

Here you can find the source of copyMatrix(final double[][] c)

Description

copy Matrix

License

Open Source License

Declaration

static double[][] copyMatrix(final double[][] c) 

Method Source Code

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

public class Main {
    static double[][] copyMatrix(final double[][] c) {
        final double[][] a = new double[c.length][];
        for (int i = 0; i < c.length; ++i) {
            a[i] = new double[c[i].length];
            for (int j = 0; j < c[i].length; ++j) {
                //Gaussian distributions with mean 0 and standard deviation 1
                a[i][j] = c[i][j];//w w  w.  j av a 2  s.c o  m
            }
        }
        return a;
    }

    static double[][][] copyMatrix(final double[][][] c) {
        final double[][][] a = new double[c.length][][];
        for (int i = 0; i < c.length; ++i) {
            a[i] = copyMatrix(c[i]);
        }
        return a;
    }
}

Related

  1. copyMatrix(boolean[][] matrix)
  2. copyMatrix(boolean[][] old)
  3. copyMatrix(final double[][] src, final double[][] dest, int n)
  4. copyMatrix(final int rowsCount, final int columnsCount, final double[][] origMatrix)
  5. copyMatrix(float[] origin, float destination[])
  6. copyMatrixBlock(final double[][] src, int i_src, int j_src, final double[][] dest, int i_dest, int j_dest, int rows, int cols)