From ddc1fe2c9286524bf3c4b303064da7a0accf2b34 Mon Sep 17 00:00:00 2001
From: Van Dung Nguyen <vdg.nguyen@gmail.com>
Date: Tue, 3 Nov 2020 16:23:21 +0100
Subject: [PATCH] correction

---
 NonLinearSolver/modelReduction/Tree.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/NonLinearSolver/modelReduction/Tree.cpp b/NonLinearSolver/modelReduction/Tree.cpp
index e00abd926..185581bb4 100644
--- a/NonLinearSolver/modelReduction/Tree.cpp
+++ b/NonLinearSolver/modelReduction/Tree.cpp
@@ -311,7 +311,15 @@ void Tree::createRandomTreeSameDepthForNodes(int nbLeaves, int numChildMax, int
         }
         else
         {
-          outPut.push_back(numChilds+remaining);
+          if (numChilds+remaining < 4)
+          {
+            outPut.push_back(numChilds+remaining);
+          }
+          else
+          {
+            outPut.push_back(2);
+            outPut.push_back(numChilds+remaining-2);
+          }
           iter += numChilds+remaining;
         }
       };
-- 
GitLab