nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit df512e74753667194faa623b99884d3590597cfd Author: Todor Balabanov <[email protected]> AuthorDate: Mon Apr 29 13:27:17 2019 +0300 Commit: Noel Grandin <[email protected]> CommitDate: Wed May 1 16:10:45 2019 +0200 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 <[email protected]> Reviewed-by: Noel Grandin <[email protected]> diff --git a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java index b6387bfb8a96..e5677818c0ef 100644 --- a/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java +++ b/nlpsolver/ThirdParty/EvolutionarySolver/src/net/adaptivebox/deps/behavior/DEGTBehavior.java @@ -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 { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
