src/utils/matrix/MMatrix.java
public MMatrix flatten() throws MatrixException {
        int rows = this.rows;
        int cols = this.columns;
        Matrix matrix = new DMatrix(rows * cols * size(), 1);
        MMatrix mmatrix = new MMatrix(1, matrix);
        for (Integer index : keySet()) {
            for (int row = 0; row < rows; row++) {
                for (int col = 0; col < cols; col++) {
                    matrix.setValue(getPosition(rows, cols, row, col, index), 0 , get(index).getValue(row, col));
                }
            }
        }
        return mmatrix;
    }
/**
     * Flattens MMatrix into one dimensional column vector (matrix)
     *
     * @return flattened MMatrix
     * @throws MatrixException throws exception if creation of MMatrix fails.
     */
Flattens MMatrix into one dimensional column vector (matrix)
@return flattened MMatrix
@throws MatrixException throws exception if creation of MMatrix fails.
Flattens MMatrix into one dimensional column vector ( matrix ) @return flattened MMatrix @throws MatrixException throws exception if creation of MMatrix fails .
public MMatrix flatten() throws MatrixException {
        int rows = this.rows;
        int cols = this.columns;
        Matrix matrix = new DMatrix(rows * cols * size(), 1);
        MMatrix mmatrix = new MMatrix(1, matrix);
        for (Integer index : keySet()) {
            for (int row = 0; row < rows; row++) {
                for (int col = 0; col < cols; col++) {
                    matrix.setValue(getPosition(rows, cols, row, col, index), 0 , get(index).getValue(row, col));
                }
            }
        }
        return mmatrix;
    }
public MMatrix flatten ( ) throws MatrixException { int rows = this . rows ; int cols = this . columns ; Matrix matrix = new DMatrix ( rows * cols * size ( ) , 1 ) ; MMatrix mmatrix = new MMatrix ( 1 , matrix ) ; for ( Integer index : keySet ( ) ) { for ( int row = 0 ; row < rows ; row ++ ) { for ( int col = 0 ; col < cols ; col ++ ) { matrix . setValue ( getPosition ( rows , cols , row , col , index ) , 0 , get ( index ) . getValue ( row , col ) ) ; } } } return mmatrix ; }
Flattens MMatrix into one dimensional column vector (matrix)
 @return flattened MMatrix
 @throws MatrixException throws exception if creation of MMatrix fails.
Flattens MMatrix into one dimensional column vector ( matrix ) @return flattened MMatrix @throws MatrixException throws exception if creation of MMatrix fails .