commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1200350 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java
Date Thu, 10 Nov 2011 14:43:44 GMT
Author: sebb
Date: Thu Nov 10 14:43:44 2011
New Revision: 1200350

URL: http://svn.apache.org/viewvc?rev=1200350&view=rev
Log:
Unnecessary casts - angbd is double, so ensures the rest of the calculation uses double

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java?rev=1200350&r1=1200349&r2=1200350&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java
Thu Nov 10 14:43:44 2011
@@ -2149,7 +2149,7 @@ public class BOBYQAOptimizer
             redsav = ZERO;
             iu = (int) (angbd * 17. + 3.1);
             for (int i = 0; i < iu; i++) {
-                angt = angbd * (double) i / (double) iu;
+                angt = angbd * i / iu;
                 sth = (angt + angt) / (ONE + angt * angt);
                 temp = shs + angt * (angt * dhd - dhs - dhs);
                 rednew = sth * (angt * dredg - sredg - HALF * sth * temp);
@@ -2171,7 +2171,7 @@ public class BOBYQAOptimizer
             }
             if (isav < iu) {
                 temp = (rdnext - rdprev) / (redmax + redmax - rdprev - rdnext);
-                angt = angbd * ((double) isav + HALF * temp) / (double) iu;
+                angt = angbd * (isav + HALF * temp) / iu;
             }
             cth = (ONE - angt * angt) / (ONE + angt * angt);
             sth = (angt + angt) / (ONE + angt * angt);



Mime
View raw message