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

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

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

Definition at line 498 of file FloatMatrix.java.

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

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

        FloatMatrix result = new FloatMatrix(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