> > +     * If {@link #maxIterationCount} is set to this value, the number of
> > +     * iterations will never cause {@link #converged(int,Pair,Pair>)}
> > +     * to return {@code true}.
> > +     */
> > +    private static final int ITERATION_CHECK_DISABLED = -1;
> 
> Could be I am misunderstanding the setup here, but I think this
> value may cause a problem with the positivity check below (i.e.
> using it will raise NotStrictlyPostiveException).

No, there is a check (and possible throw) only in the constructor that has
this parameter.
In the others, the value ITERATION_CHECK_DISABLED is directly assigned, and
the method "converged" checks "maxIterationCount" only if it is not equal
to ITERATION_CHECK_DISABLED.

>  The test at the
> end does not test using this value.  IIUC the code, a test that did
> would throw.  Might be better to use Integer.MAX_VALUE or a boolean
> flag.

A boolean flag would be clearer, I agree, but there would have to be one per
object, whereas here we can get away with just one additional class
variable.

>  Also, javadoc says negative values for maxIter disable.  The
> code actually throws.

A negative value is just wrong, and it should raise an exception.
To disable, one has to create an instance with the other constructor.  I'll
correct the doc.


Thanks,
Gilles

> [...]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to