[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - nlpsolver/src

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 30 15:19:59 UTC 2020


 nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java |    4 ++++
 nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java         |    4 ++++
 nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/SCOSolverImpl.java          |    5 +++++
 3 files changed, 13 insertions(+)

New commits:
commit 3a320677aec00c8d769bc5a3072851cf2c825ef5
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Tue Jul 28 11:32:03 2020 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Jul 30 17:19:26 2020 +0200

    Related tdf#135211: return early if no data
    
    With DEPS or SCO Evolutionary algorithms, it'll return
    "No solution found."
    Change-Id: I15e8e24eb519a20e3f3645b79e990949f648fbd2
    
    Change-Id: I7321419ccc1cd00d75f03fa86d3c0cb4bf9ad473
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99584
    Tested-by: Julien Nabet <serval2412 at yahoo.fr>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    (cherry picked from commit a7e92d71d72d69b887bf716f30af37105f206915)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99548
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
    (cherry picked from commit 158a3f478ff021be3c30fcc73b9ba779f4b40fbb)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99738
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java
index c0b10c2f4951..c5724ca5461e 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseEvolutionarySolver.java
@@ -189,6 +189,10 @@ public abstract class BaseEvolutionarySolver extends BaseNLPSolver {
     protected void initializeSolve() {
         super.initializeSolve();
 
+        if (m_variableCount == 0)
+        {
+            return;
+        }
         if (m_enhancedSolverStatus.getValue())
             m_solverStatusDialog = new EvolutionarySolverStatusUno(m_xContext);
         else
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java
index f152cf92d481..aff425ba4e20 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/DEPSSolverImpl.java
@@ -119,6 +119,10 @@ public final class DEPSSolverImpl extends BaseEvolutionarySolver
             Logger.getLogger(DEPSSolverImpl.class.getName()).log(Level.SEVERE, null, ex);
         }
         initializeSolve();
+        if (m_problemEncoder == null)
+        {
+            return;
+        }
 
         //Init:
         DEPSAgent[] agents = new DEPSAgent[m_swarmSize.getValue()];
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/SCOSolverImpl.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/SCOSolverImpl.java
index cefe51006751..c1798606d4e6 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/SCOSolverImpl.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/SCOSolverImpl.java
@@ -90,6 +90,11 @@ public final class SCOSolverImpl extends BaseEvolutionarySolver
     public void solve() {
         initializeSolve();
 
+        if (m_problemEncoder == null)
+        {
+            return;
+        }
+
         //Init:
         int swarmSize = m_swarmSize.getValue();
         SCAgent[] agents = new SCAgent[swarmSize];


More information about the Libreoffice-commits mailing list