Math pow is too slow in this case.
Change-Id: I16149cabf75ec928d96975e4b98622df6951cefc Reviewed-on: https://gerrit.libreoffice.org/71519 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
f82356d9a1
commit
df512e7475
Vendored
+1
-1
@@ -57,7 +57,7 @@ public class DEGTBehavior extends AbsGTBehavior implements ILibEngine {
|
||||
if (Math.random()<CR || k == DIMENSION-1) {
|
||||
double Dabcd = 0;
|
||||
for(int i=0; i<referPoints.length; i++) {
|
||||
Dabcd += Math.pow(-1, i%2)*referPoints[i].getLocation()[rj];
|
||||
Dabcd += (i%2==0 ? +1D : -1D)*referPoints[i].getLocation()[rj];
|
||||
}
|
||||
trailPoint.getLocation()[rj] = gbest_t.getLocation()[rj]+FACTOR*Dabcd;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user