class Matrix implements Cloneable {

    public static Matrix diagonal(final double[] d) {
        Matrix M = new Matrix(d.length, d.length);
        for (int i = 0, j = 0; i < d.length; ++i, j += d.length + 1) {
            M.data_[j] = d[i];
        }
        return M;
    }

    public  Matrix(final double[] data, final int nrows, final int ncols);
    public  Matrix(final int nrows, final int ncols);
    public  Matrix(final SubMatrix sm);

}