class Polynomial implements IReadDataBlock {

    public Polynomial times(final double d) {
        if (d == 0d || this.isZero()) {
            return Polynomial.ZERO;
        }
        if (d == 1d) {
            return this;
        }
        double[] coefficients = Doubles.fromDegree(degree);
        for (int i = 0; i <= degree; ++i) {
            coefficients[i] = get(i) * d;
        }
        Polynomial result = new Polynomial(coefficients, degree);
        result.defRoots.set(defRoots.get());
        return result;
    }

    private  Polynomial(final double[] coefficients, final int degree);

}