class DiagonalMatrix extends AbstractRealMatrix implements Serializable {

    @Override
    public void multiplyEntry(final int row,
                              final int column,
                              final double factor)
        throws OutOfRangeException {
        // we don't care about non-diagonal elements for multiplication
        if (row == column) {
            MatrixUtils.checkRowIndex(this, row);
            data[row] *= factor;
        }
    }

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

}