class SubMatrix implements Cloneable {

    public void chs() {
        if (m_row_inc == 1) {
            for (int c = 0, ic = m_start; c < m_ncols; ++c, ic += m_col_inc) {
                for (int r = 0, ir = ic; r < m_nrows; ++r, ++ir) {
                    m_data[ir] = -m_data[ir];
                }
            }
        } else if (m_col_inc == 1) {
            for (int r = 0, ir = m_start; r < m_nrows; ++r, ir += m_row_inc) {
                for (int c = 0, ic = ir; c < m_ncols; ++c, ++ic) {
                    m_data[ic] = -m_data[ic];
                }
            }
        } else {
            for (int c = 0, ic = m_start; c < m_ncols; ++c, ic += m_col_inc) {
                for (int r = 0, ir = ic; r < m_nrows; ++r, ir += m_row_inc) {
                    m_data[ir] = -m_data[ir];
                }
            }
        }
    }

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

}