Kaydet (Commit) df512e74 authored tarafından Todor Balabanov's avatar Todor Balabanov Kaydeden (comit) Noel Grandin

Math pow is too slow in this case.

Change-Id: I16149cabf75ec928d96975e4b98622df6951cefc
Reviewed-on: https://gerrit.libreoffice.org/71519
Tested-by: Jenkins
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst f82356d9
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment