Java Matrix matrixConcatUL(double[][] UMatrix, double[][] LMatrix)

Here you can find the source of matrixConcatUL(double[][] UMatrix, double[][] LMatrix)

Description

matrix Concat UL

License

Open Source License

Declaration

public static double[][] matrixConcatUL(double[][] UMatrix,
            double[][] LMatrix) 

Method Source Code

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

public class Main {
    public static double[][] matrixConcatUL(double[][] UMatrix,
            double[][] LMatrix) {
        if (LMatrix[0].length != UMatrix[0].length) {
            System.out//from  w w w  . ja  v a 2  s . c  om
                    .println("matrixConcatUL error: the number of columns in two matrix should be same");
            System.exit(0);
        }

        int numURows = UMatrix.length;
        int numLRows = LMatrix.length;
        int numCols = UMatrix[0].length;

        double[][] newMatrix = new double[numURows + numLRows][numCols];

        System.arraycopy(UMatrix, 0, newMatrix, 0, numURows);
        System.arraycopy(LMatrix, 0, newMatrix, numURows, numLRows);

        return newMatrix;
    }
}

Related

  1. matrix_x_matrix(double[][] A, double[][] B)
  2. matrix_x_vectorMatrix(double[][] mat, double[][] vector, int vectorCol)
  3. matrixAbsDiff(double m1[][], double m2[][])
  4. matrixATrans_x_matrixB(double[][] matA, double[][] matB)
  5. matrixConcatLR(double[][] LMatrix, double[][] RMatrix)
  6. matrixDestructAdd(double[][] m1, double[][] m2)
  7. matrixDeterminant(final float[] m, final int m_offset)
  8. matrixEquals(int[][] firstMatrix, int[][] secondMatrix)
  9. matrixIsWellformed(int numLabels, int[][] matrix)