Logo Search packages:      
Sourcecode: jblas version File versions  Download package

static DoubleMatrix org::jblas::la::DoubleMatrix::concatVertically ( DoubleMatrix  A,
DoubleMatrix  B 
) [inline, static]

Concatenates two matrices vertically. Matrices must have identical numbers of columns.

Definition at line 498 of file DoubleMatrix.java.

References columns, data, DoubleMatrix(), index(), and rows.

                                                                                {
        if (A.columns != B.columns) {
            throw new SizeException("Matrices don't have same number of columns (" + A.columns + " != " + B.columns + ".");
        }

        DoubleMatrix result = new DoubleMatrix(A.rows + B.rows, A.columns);

        for (int i = 0; i < A.columns; i++) {
            JavaBlas.rcopy(A.rows, A.data, A.index(0, i), 1, result.data, result.index(0, i), 1);
            JavaBlas.rcopy(B.rows, B.data, B.index(0, i), 1, result.data, result.index(A.rows, i), 1);
        }

        return result;
    }


Generated by  Doxygen 1.6.0   Back to index