* Bug 10014 fixed: DominationRank() made private in optim_nsga2() 51/21051/7
Samuel GOUGEON [Wed, 24 Jul 2019 20:37:13 +0000 (22:37 +0200)]
  http://bugzilla.scilab.org/10014

Change-Id: I48920f5c1eb97a6521defa08cc58d882534319a6

scilab/CHANGES.md
scilab/modules/optimization/macros/genetic/DominationRank.sci [deleted file]
scilab/modules/optimization/macros/genetic/optim_nsga2.sci

index 15162e4..dbe4b7f 100644 (file)
@@ -289,6 +289,7 @@ Bug Fixes
 * [#9130](https://bugzilla.scilab.org/9130): In the SigBuilder Xcos page, the parameters of the block were not described. The page refered to the CURVE_c block removed fron Scilab 5.0.0.
 * [#9529](https://bugzilla.scilab.org/9529): `assert_checkequal(list(1,,3), list(1,,3))` yielded an error.
 * [#9673](https://bugzilla.scilab.org/9673): Priority of colon `:` operator was too low
+* [#10014](https://bugzilla.scilab.org/10014): `DominationRank` could be made private in `optim_nsga2`.
 * [#10078](https://bugzilla.scilab.org/10078): `isinf` was not reliable for polynomials.
 * [#10092](https://bugzilla.scilab.org/10092): The left and right Kronecker divisions were not actually implemented nor documented.
 * [#10353](https://bugzilla.scilab.org/10353): Documentation: The referential for the uicontrol.position property was not provided. Moreover, `gca().axes_bounds` refered to `fig.figure_size` instead of `fig.axes_size`.
diff --git a/scilab/modules/optimization/macros/genetic/DominationRank.sci b/scilab/modules/optimization/macros/genetic/DominationRank.sci
deleted file mode 100644 (file)
index d446140..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2011 - INRIA - Serge STEER
-//
-// Copyright (C) 2012 - 2016 - Scilab Enterprises
-//
-// This file is hereby licensed under the terms of the GNU GPL v2.0,
-// pursuant to article 5.3.4 of the CeCILL v.2.1.
-// This file was originally licensed under the terms of the CeCILL v2.1,
-// and continues to be available under such terms.
-// For more information, see the COPYING file which you should have received
-// along with this program.
-
-function Rank=DominationRank(All_FObj)
-    Rank  = zeros(All_FObj)
-    if size(All_FObj,2)==1 then
-        [T,Ind]=gsort(All_FObj,"g","i");
-        group_length=diff([0 find(diff(T)>0)]);
-        Ngroup=size(group_length,"*");
-        k=1;
-        for Count=1:Ngroup
-            Rank(k:k+group_length(Count)-1)=Count;
-            k=k+group_length(Count);
-        end
-        Rank(Ind)=Rank;
-    else
-        MO_All_FObj = All_FObj;
-        // Compute the domination rank on all the population
-        Index = 1:size(MO_All_FObj,1);
-        Count = 1;
-        while size(MO_All_FObj,1)>1
-            [tmp1,tmp2,Index_List]  = pareto_filter(MO_All_FObj);
-            Rank(Index(Index_List)) = Count;
-            Count = Count + 1;
-            MO_All_FObj(Index_List,:) = [];
-            Index(Index_List)          = [];
-        end
-    end
-endfunction
index 624f4f2..3bd5668 100644 (file)
@@ -228,3 +228,45 @@ function [pop_opt, fobj_pop_opt, pop_init, fobj_pop_init] = optim_nsga2(ga_f, po
     pop_opt      = codage_func(Pop, "decode", param);
     fobj_pop_opt = FObj_Pop;
 endfunction
+
+// =================================================================
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - INRIA - Serge STEER
+//
+// Copyright (C) 2012 - 2016 - Scilab Enterprises
+//
+// This file is hereby licensed under the terms of the GNU GPL v2.0,
+// pursuant to article 5.3.4 of the CeCILL v.2.1.
+// This file was originally licensed under the terms of the CeCILL v2.1,
+// and continues to be available under such terms.
+// For more information, see the COPYING file which you should have received
+// along with this program.
+
+function Rank=DominationRank(All_FObj)
+    Rank  = zeros(All_FObj)
+    if size(All_FObj,2)==1 then
+        [T,Ind]=gsort(All_FObj,"g","i");
+        group_length=diff([0 find(diff(T)>0)]);
+        Ngroup=size(group_length,"*");
+        k=1;
+        for Count=1:Ngroup
+            Rank(k:k+group_length(Count)-1)=Count;
+            k=k+group_length(Count);
+        end
+        Rank(Ind)=Rank;
+    else
+        MO_All_FObj = All_FObj;
+        // Compute the domination rank on all the population
+        Index = 1:size(MO_All_FObj,1);
+        Count = 1;
+        while size(MO_All_FObj,1)>1
+            [tmp1,tmp2,Index_List]  = pareto_filter(MO_All_FObj);
+            Rank(Index(Index_List)) = Count;
+            Count = Count + 1;
+            MO_All_FObj(Index_List,:) = [];
+            Index(Index_List)          = [];
+        end
+    end
+endfunction
+