class SubMatrix implements Cloneable {

    public void xmy(SubMatrix x, SubMatrix y) {
        if (m_nrows != m_ncols || x.m_nrows != x.m_ncols || y.m_nrows != y.m_ncols
                || m_nrows != x.m_nrows || m_nrows != y.m_nrows) {
            throw new MatrixException(MatrixException.IncompatibleDimensions);
        }
        // computes my.
        // rows mi of m are replaced by mi * src
        DataBlock tmp = new DataBlock(m_nrows);
        DataBlockIterator mrows = rows();
        DataBlock mrow = mrows.getData();
        do {
            tmp.copy(mrow);
            mrow.product(tmp, y.columns());
        } while (mrows.next());

        // computes src m. 
        DataBlockIterator mcols = columns();
        DataBlock mcol = mcols.getData();
        do {
            tmp.copy(mcol);
            mcol.product(x.rows(), tmp);
        } while (mcols.next());

    }

    public  SubMatrix(final double[] data, final int nrows, final int ncols);
    public  SubMatrix(final double[] data, final int start, final int nrows,
            final int ncols, final int rowinc, final int colinc);
    public  SubMatrix(final SubMatrix m);

}