class SubMatrix implements Cloneable {

    public void sub(final SubMatrix m) {
        // special handling of full matrices
        if (isFull() && m.isFull()) {
            for (int i = 0; i < m_data.length; ++i) {
                m_data[i] -= m.m_data[i];
            }
            return;
        }
        // if (m_nrows != m.m_nrows || m_ncols != m.m_ncols)
        // throw new MatrixException(MatrixException.IncompatibleDimensions);
        DataBlockIterator iter, siter;
        if (m.m_row_inc == 1 && m_row_inc == 1) {
            iter = columns();
            siter = m.columns();
        } else {
            iter = rows();
            siter = m.rows();
        }

        DataBlock icur = iter.getData(), sicur = siter.getData();
        do {
            icur.sub(sicur);
        } while (iter.next() && siter.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);

}