class SubMatrix implements Cloneable {

    public DataBlock subDiagonal(int pos) {
        if (pos >= m_ncols) {
            return DataBlock.EMPTY;
        }
        if (-pos >= m_nrows) {
            return DataBlock.EMPTY;
        }
        int beg = m_start, inc = m_row_inc + m_col_inc;
        int n;
        if (pos > 0) {
            beg += pos * m_col_inc;
            n = Math.min(m_nrows, m_ncols - pos);
        } else if (pos < 0) {
            beg -= pos * m_row_inc;
            n = Math.min(m_nrows + pos, m_ncols);
        } else {
            n = Math.min(m_nrows, m_ncols);
        }
        return new DataBlock(m_data, beg, beg + inc * n, inc);
    }

    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);

}