src/utils/matrix/AbstractMatrix.java
public Matrix concatenateVertical(double other, boolean inplace, boolean concatenateAfter) throws MatrixException {
        int columns = getColumns();
        if (columns != 1) throw new MatrixException("Merge Vertical: Incompatible matrix sizes: " + getRows() + "x" + getColumns() + " by " + "1 x 1");
        int rows = getRows();
        Matrix newMatrix = getNewMatrix(rows + 1, columns);
        int thisOffsetRow = concatenateAfter ? 0 : 1;
        int otherOffsetRow = concatenateAfter ? rows : 0;
        for (int column = 0; column < columns; column++) {
            for (int row = 0; row < rows; row++) {
                newMatrix.setValue(thisOffsetRow + row, column, getValue(row, column));
            }
            newMatrix.setValue(otherOffsetRow, column, other);
        }
        if (inplace) copyMatrixData(newMatrix);
        return newMatrix;
    }
/**
     * Concatenates this matrix and other value vertically in place.
     *
     * @param other matrix to be concatenated to the end of this matrix vertically.
     * @param inplace if true other matrix is concatenated to this matrix in place.
     * @param concatenateAfter if true data of other matrix is concatenated after this matrix otherwise opposite is true.
     * @return concatenated matrix.
     * @throws MatrixException throws exception if column dimensions of this and other matrix are not matching.
     */
Concatenates this matrix and other value vertically in place.

@param other matrix to be concatenated to the end of this matrix vertically.
@param inplace if true other matrix is concatenated to this matrix in place.
@param concatenateAfter if true data of other matrix is concatenated after this matrix otherwise opposite is true.
@return concatenated matrix.
@throws MatrixException throws exception if column dimensions of this and other matrix are not matching.
Concatenates this matrix and other value vertically in place . @param other matrix to be concatenated to the end of this matrix vertically . @param inplace if true other matrix is concatenated to this matrix in place . @param concatenateAfter if true data of other matrix is concatenated after this matrix otherwise opposite is true . @return concatenated matrix . @throws MatrixException throws exception if column dimensions of this and other matrix are not matching .
public Matrix concatenateVertical(double other, boolean inplace, boolean concatenateAfter) throws MatrixException {
        int columns = getColumns();
        if (columns != 1) throw new MatrixException("Merge Vertical: Incompatible matrix sizes: " + getRows() + "x" + getColumns() + " by " + "1 x 1");
        int rows = getRows();
        Matrix newMatrix = getNewMatrix(rows + 1, columns);
        int thisOffsetRow = concatenateAfter ? 0 : 1;
        int otherOffsetRow = concatenateAfter ? rows : 0;
        for (int column = 0; column < columns; column++) {
            for (int row = 0; row < rows; row++) {
                newMatrix.setValue(thisOffsetRow + row, column, getValue(row, column));
            }
            newMatrix.setValue(otherOffsetRow, column, other);
        }
        if (inplace) copyMatrixData(newMatrix);
        return newMatrix;
    }
public Matrix concatenateVertical ( double other , boolean inplace , boolean concatenateAfter ) throws MatrixException { int columns = getColumns ( ) ; if ( columns != 1 ) throw new MatrixException ( "Merge Vertical: Incompatible matrix sizes: " + getRows ( ) + "x" + getColumns ( ) + " by " + "1 x 1" ) ; int rows = getRows ( ) ; Matrix newMatrix = getNewMatrix ( rows + 1 , columns ) ; int thisOffsetRow = concatenateAfter ? 0 : 1 ; int otherOffsetRow = concatenateAfter ? rows : 0 ; for ( int column = 0 ; column < columns ; column ++ ) { for ( int row = 0 ; row < rows ; row ++ ) { newMatrix . setValue ( thisOffsetRow + row , column , getValue ( row , column ) ) ; } newMatrix . setValue ( otherOffsetRow , column , other ) ; } if ( inplace ) copyMatrixData ( newMatrix ) ; return newMatrix ; }
Concatenates this matrix and other value vertically in place.
Concatenates this matrix and other value vertically in place .