Java Matrix Sum sum(double[][] kernel1, double[][] kernel2)

Here you can find the source of sum(double[][] kernel1, double[][] kernel2)

Description

Sum two kernel matrices

License

Open Source License

Parameter

Parameter Description
kernel1 a parameter
kernel2 a parameter

Declaration

public static double[][] sum(double[][] kernel1, double[][] kernel2) 

Method Source Code

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

public class Main {
    /**/*from w  w  w. j  a  v a2  s  .  c  o m*/
     * Sum two kernel matrices
     * 
     * @param kernel1
     * @param kernel2
     * @return
     */
    public static double[][] sum(double[][] kernel1, double[][] kernel2) {
        double[][] kernel = new double[kernel1.length][kernel1.length];

        for (int i = 0; i < kernel1.length; i++) {
            for (int j = i; j < kernel1[i].length; j++) {
                kernel[i][j] = kernel1[i][j] + kernel2[i][j];
            }
        }
        return kernel;
    }
}

Related

  1. sum(double[][] data, int rows, int cols)
  2. sum(double[][] error)
  3. sum(double[][] input, int column)
  4. sum(double[][] input, int column)
  5. sum(double[][] o)
  6. sum(double[][] X, int axis)
  7. sum(float[][] a1, float[][] a2)
  8. sum(int M[][])