class DiagonalMatrix extends AbstractRealMatrix implements Serializable {

    @Override
    public double[][] getData() {
        final int dim = getRowDimension();
        final double[][] out = new double[dim][dim];

        for (int i = 0; i < dim; i++) {
            out[i][i] = data[i];
        }

        return out;
    }

    public  DiagonalMatrix(final int dimension);
    public  DiagonalMatrix(final double[] d);
    public  DiagonalMatrix(final double[] d, final boolean copyArray);

}