commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: svn commit: r1090656 - in /commons/proper/math/trunk: ./ src/main/java/org/apache/commons/math/optimization/linear/ src/site/xdoc/ src/test/java/org/apache/commons/math/optimization/linear/
Date Sat, 09 Apr 2011 21:51:30 GMT
Hello Luc.

> >>          for (int i = tableau.getNumObjectiveFunctions(); i < tableau.getWidth()
- 1; i++) {
> >> -            if (MathUtils.compareTo(tableau.getEntry(0, i), minValue, epsilon)
< 0) {
> >> -                minValue = tableau.getEntry(0, i);
> >> +            final double entry = tableau.getEntry(0, i);
> >> +            if (MathUtils.compareTo(entry, minValue, getEpsilon(entry)) <
0) {
> > 
> >                                                        ^^^^^^^^^^^^^^^^^^
> > 
> > I thought that Thomas agreed that "MathUtils.equals(double,double,int)"
> > should be used instead of "getEpsilon".
> 
> His getEpsilon method uses the maxUlp value. Some of the tests also
> check for sign (like the one you quoite here) and not for equality.
> 
> I'll check this again tomorrow and will fix the equality tests.

I know nothing about the details of this algorithm, but what I thought I had
understood about the requested changes is that they were linked to the use
of "ulps" and thus, I think that it would be preferrable to use them
explicitely in the algorithm instead of "getEpsilon"; we would avoid a mix
of "double" (epsilon) and "int" (maxUlps) variables (where the former in
fact hides the latter).
If necessary we could also add "compareTo(double, double, int)" in
"MathUtils".


Best regards,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message