1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372
|
Description: Use ... for continuation marker to avoid deprecated syntax warning
Origin: upstream, https://sourceforge.net/p/octave/ga/ci/48d6211f8f36b0ca98b922702decdb84ecaef23a/
Reviewed-by: Sébastien Villemot <sebastien@debian.org>
Last-Update: 2018-06-17
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
diff -r 6f794cc0f9b1 -r 48d6211f8f36 inst/__ga_crossoverfcn__.m
--- a/inst/__ga_crossoverfcn__.m Tue Jun 18 17:40:36 2013 +0100
+++ b/inst/__ga_crossoverfcn__.m Wed Aug 28 16:28:28 2013 -0400
@@ -26,7 +26,7 @@
error ("'parents' must have an even number of columns");
endif
- xoverKids(1:(nc_parents / 2), 1:nvars) = options.CrossoverFcn \
+ xoverKids(1:(nc_parents / 2), 1:nvars) = options.CrossoverFcn ...
(parents(1, 1:nc_parents), options, nvars, FitnessFcn,
unused,
thisPopulation(:, 1:nvars));
diff -r 6f794cc0f9b1 -r 48d6211f8f36 inst/__ga_initial_population__.m
--- a/inst/__ga_initial_population__.m Tue Jun 18 17:40:36 2013 +0100
+++ b/inst/__ga_initial_population__.m Wed Aug 28 16:28:28 2013 -0400
@@ -26,10 +26,10 @@
#TODO consider PopulationSize as a
#vector for multiple subpopolations
-function Population = \
+function Population = ...
__ga_initial_population__ (GenomeLength, FitnessFcn, options)
if (isempty (options.InitialPopulation))
- Population(1:options.PopulationSize, 1:GenomeLength) = \
+ Population(1:options.PopulationSize, 1:GenomeLength) = ...
options.CreationFcn (GenomeLength, FitnessFcn, options);
else
if (columns (options.InitialPopulation) != GenomeLength) ## columns (InitialPopulation) > 0
@@ -40,15 +40,15 @@
error ("nonempty 'InitialPopulation' must have no more than \
'PopulationSize' rows");
elseif (nrIP == options.PopulationSize)
- Population(1:options.PopulationSize, 1:GenomeLength) = \
+ Population(1:options.PopulationSize, 1:GenomeLength) = ...
options.InitialPopulation;
else # rows (InitialPopulation) < PopulationSize
## create a complete new population, and then select only needed
## individuals (creating only a partial population is difficult)
- CreatedPopulation(1:options.PopulationSize, 1:GenomeLength) = \
+ CreatedPopulation(1:options.PopulationSize, 1:GenomeLength) = ...
options.CreationFcn (GenomeLength, FitnessFcn, options);
- Population(1:options.PopulationSize, 1:GenomeLength) = vertcat \
+ Population(1:options.PopulationSize, 1:GenomeLength) = vertcat ...
(options.InitialPopulation(1:nrIP, 1:GenomeLength),
CreatedPopulation(1:(options.PopulationSize - nrIP),
1:GenomeLength));
diff -r 6f794cc0f9b1 -r 48d6211f8f36 inst/__ga_mutationfcn__.m
--- a/inst/__ga_mutationfcn__.m Tue Jun 18 17:40:36 2013 +0100
+++ b/inst/__ga_mutationfcn__.m Wed Aug 28 16:28:28 2013 -0400
@@ -16,11 +16,11 @@
## Author: Luca Favatella <slackydeb@gmail.com>
## Version: 1.3
-function mutationChildren = \
+function mutationChildren = ...
__ga_mutationfcn__ (parents, options, nvars, FitnessFcn,
state, thisScore,
thisPopulation)
- mutationChildren(1:(columns (parents)), 1:nvars) = \
+ mutationChildren(1:(columns (parents)), 1:nvars) = ...
options.MutationFcn{1, 1} (parents(1, :), options, nvars, FitnessFcn,
state, thisScore,
thisPopulation(:, 1:nvars));
diff -r 6f794cc0f9b1 -r 48d6211f8f36 inst/__ga_problem__.m
--- a/inst/__ga_problem__.m Tue Jun 18 17:40:36 2013 +0100
+++ b/inst/__ga_problem__.m Wed Aug 28 16:28:28 2013 -0400
@@ -26,7 +26,7 @@
"randnstate", randn ("state"));
## instructions not to be executed at each generation
- state.Population(1:problem.options.PopulationSize, 1:problem.nvars) = \
+ state.Population(1:problem.options.PopulationSize, 1:problem.nvars) = ...
__ga_initial_population__ (problem.nvars,
problem.fitnessfcn,
problem.options);
@@ -45,20 +45,20 @@
## elite
if (private_state.ReproductionCount.elite > 0)
[trash IndexSortedScores] = sort (state.Score);
- NextPopulation(state.Selection.elite, 1:problem.nvars) = \
- state.Population \
+ NextPopulation(state.Selection.elite, 1:problem.nvars) = ...
+ state.Population ...
(IndexSortedScores(1:private_state.ReproductionCount.elite, 1),
1:problem.nvars);
endif
## selection for crossover and mutation
- parents(1, 1:private_state.nParents) = __ga_selectionfcn__ \
+ parents(1, 1:private_state.nParents) = __ga_selectionfcn__ ...
(state.Expectation, private_state.nParents, problem.options);
## crossover
if (private_state.ReproductionCount.crossover > 0)
- NextPopulation(state.Selection.crossover, 1:problem.nvars) = \
- __ga_crossoverfcn__ \
+ NextPopulation(state.Selection.crossover, 1:problem.nvars) = ...
+ __ga_crossoverfcn__ ...
(parents(1, private_state.parentsSelection.crossover),
problem.options, problem.nvars, problem.fitnessfcn,
false, ## unused
@@ -67,8 +67,8 @@
## mutation
if (private_state.ReproductionCount.mutation > 0)
- NextPopulation(state.Selection.mutation, 1:problem.nvars) = \
- __ga_mutationfcn__ \
+ NextPopulation(state.Selection.mutation, 1:problem.nvars) = ...
+ __ga_mutationfcn__ ...
(parents(1, private_state.parentsSelection.mutation),
problem.options, problem.nvars, problem.fitnessfcn,
state, state.Score,
@@ -83,7 +83,7 @@
private_state);
endwhile
- [x fval exitflag output population scores] = \
+ [x fval exitflag output population scores] = ...
__ga_problem_return_variables__ (state, problem);
endfunction
diff -r 6f794cc0f9b1 -r 48d6211f8f36 inst/__ga_problem_private_state__.m
--- a/inst/__ga_problem_private_state__.m Tue Jun 18 17:40:36 2013 +0100
+++ b/inst/__ga_problem_private_state__.m Wed Aug 28 16:28:28 2013 -0400
@@ -18,11 +18,11 @@
function private_state = __ga_problem_private_state__ (options)
private_state.ReproductionCount.elite = options.EliteCount;
- private_state.ReproductionCount.crossover = \
+ private_state.ReproductionCount.crossover = ...
fix (options.CrossoverFraction *
(options.PopulationSize - options.EliteCount));
- private_state.ReproductionCount.mutation = \
- options.PopulationSize - \
+ private_state.ReproductionCount.mutation = ...
+ options.PopulationSize - ...
(private_state.ReproductionCount.elite +
private_state.ReproductionCount.crossover);
assert (private_state.ReproductionCount.elite +
@@ -30,18 +30,18 @@
private_state.ReproductionCount.mutation,
options.PopulationSize); ## DEBUG
- private_state.parentsCount.crossover = \
+ private_state.parentsCount.crossover = ...
2 * private_state.ReproductionCount.crossover;
- private_state.parentsCount.mutation = \
+ private_state.parentsCount.mutation = ...
1 * private_state.ReproductionCount.mutation;
- private_state.nParents = \
- private_state.parentsCount.crossover + \
+ private_state.nParents = ...
+ private_state.parentsCount.crossover + ...
private_state.parentsCount.mutation;
- private_state.parentsSelection.crossover = \
+ private_state.parentsSelection.crossover = ...
1:private_state.parentsCount.crossover;
- private_state.parentsSelection.mutation = \
- private_state.parentsCount.crossover + \
+ private_state.parentsSelection.mutation = ...
+ private_state.parentsCount.crossover + ...
(1:private_state.parentsCount.mutation);
assert (length (private_state.parentsSelection.crossover) +
length (private_state.parentsSelection.mutation),
diff -r 6f794cc0f9b1 -r 48d6211f8f36 inst/__ga_problem_return_variables__.m
--- a/inst/__ga_problem_return_variables__.m Tue Jun 18 17:40:36 2013 +0100
+++ b/inst/__ga_problem_return_variables__.m Wed Aug 28 16:28:28 2013 -0400
@@ -16,7 +16,7 @@
## Author: Luca Favatella <slackydeb@gmail.com>
## Version: 1.1
-function [x fval exitflag output population scores] = \
+function [x fval exitflag output population scores] = ...
__ga_problem_return_variables__ (state, problem)
[trash IndexMinScore] = min (state.Score);
x = state.Population(IndexMinScore, 1:problem.nvars);
diff -r 6f794cc0f9b1 -r 48d6211f8f36 inst/__ga_problem_state_selection__.m
--- a/inst/__ga_problem_state_selection__.m Tue Jun 18 17:40:36 2013 +0100
+++ b/inst/__ga_problem_state_selection__.m Wed Aug 28 16:28:28 2013 -0400
@@ -18,12 +18,12 @@
function Selection = __ga_problem_state_selection__ (private_state, options)
Selection.elite = 1:private_state.ReproductionCount.elite;
- Selection.crossover = \
- private_state.ReproductionCount.elite + \
+ Selection.crossover = ...
+ private_state.ReproductionCount.elite + ...
(1:private_state.ReproductionCount.crossover);
- Selection.mutation = \
- private_state.ReproductionCount.elite + \
- private_state.ReproductionCount.crossover + \
+ Selection.mutation = ...
+ private_state.ReproductionCount.elite + ...
+ private_state.ReproductionCount.crossover + ...
(1:private_state.ReproductionCount.mutation);
#assert (length (Selection.elite) +
# length (Selection.crossover) +
diff -r 6f794cc0f9b1 -r 48d6211f8f36 inst/__ga_problem_update_state_at_each_generation__.m
--- a/inst/__ga_problem_update_state_at_each_generation__.m Tue Jun 18 17:40:36 2013 +0100
+++ b/inst/__ga_problem_update_state_at_each_generation__.m Wed Aug 28 16:28:28 2013 -0400
@@ -16,18 +16,18 @@
## Author: Luca Favatella <slackydeb@gmail.com>
## Version: 1.3.1
-function state = \
+function state = ...
__ga_problem_update_state_at_each_generation__ (state, problem,
private_state)
if ((state.Generation > 0) || isempty (problem.options.InitialScores))
- state.Score(1:problem.options.PopulationSize, 1) = \
+ state.Score(1:problem.options.PopulationSize, 1) = ...
__ga_scores__ (problem, state.Population);
else ## (Generation == 0) && (! isempty (InitialScores))
nrIS = rows (problem.options.InitialScores);
#assert (rows (problem.options.InitialPopulation) <= problem.options.PopulationSize); ## DEBUG
if (nrIS <= rows (problem.options.InitialPopulation))
missing_rows = (nrIS+1):problem.options.PopulationSize;
- state.Score(1:problem.options.PopulationSize, 1) = \
+ state.Score(1:problem.options.PopulationSize, 1) = ...
[problem.options.InitialScores(:, 1);
(__ga_scores__ (problem, state.Population(missing_rows, :)))
];
@@ -35,7 +35,7 @@
error ("rows (InitialScores) > rows (InitialPopulation)");
endif
endif
- state.Expectation(1, 1:problem.options.PopulationSize) = \
+ state.Expectation(1, 1:problem.options.PopulationSize) = ...
problem.options.FitnessScalingFcn (state.Score, private_state.nParents);
state.Best(state.Generation + 1, 1) = min (state.Score);
endfunction
diff -r 6f794cc0f9b1 -r 48d6211f8f36 inst/__ga_selectionfcn__.m
--- a/inst/__ga_selectionfcn__.m Tue Jun 18 17:40:36 2013 +0100
+++ b/inst/__ga_selectionfcn__.m Wed Aug 28 16:28:28 2013 -0400
@@ -17,6 +17,6 @@
## Version: 1.2
function parents = __ga_selectionfcn__ (expectation, nParents, options)
- parents(1, 1:nParents) = \
+ parents(1, 1:nParents) = ...
options.SelectionFcn (expectation(1, :), nParents, options);
endfunction
\ No newline at end of file
diff -r 6f794cc0f9b1 -r 48d6211f8f36 inst/__ga_stop__.m
--- a/inst/__ga_stop__.m Tue Jun 18 17:40:36 2013 +0100
+++ b/inst/__ga_stop__.m Wed Aug 28 16:28:28 2013 -0400
@@ -24,13 +24,13 @@
## Version: 5.1
function stop = __ga_stop__ (problem, state)
- Generations = \
+ Generations = ...
(state.Generation >= problem.options.Generations);
- TimeLimit = \
+ TimeLimit = ...
((time () - state.StartTime) >= problem.options.TimeLimit);
- FitnessLimit = \
+ FitnessLimit = ...
(state.Best(state.Generation + 1, 1) <= problem.options.FitnessLimit);
stop = (Generations ||
diff -r 6f794cc0f9b1 -r 48d6211f8f36 inst/crossoverscattered.m
--- a/inst/crossoverscattered.m Tue Jun 18 17:40:36 2013 +0100
+++ b/inst/crossoverscattered.m Wed Aug 28 16:28:28 2013 -0400
@@ -27,12 +27,12 @@
## child = [varA varB var3 varD]
nc_parents = columns (parents);
n_children = nc_parents / 2;
- p1(1:n_children, 1:nvars) = \
+ p1(1:n_children, 1:nvars) = ...
thisPopulation(parents(1, 1:n_children), 1:nvars);
- p2(1:n_children, 1:nvars) = \
+ p2(1:n_children, 1:nvars) = ...
thisPopulation(parents(1, n_children + (1:n_children)), 1:nvars);
b(1:n_children, 1:nvars) = randi (1, n_children, nvars); ## TODO: test randi
- xoverKids(1:n_children, 1:nvars) = \
+ xoverKids(1:n_children, 1:nvars) = ...
b .* p1 + (ones (n_children, nvars) - b) .* p2;
endfunction
diff -r 6f794cc0f9b1 -r 48d6211f8f36 inst/fitscalingrank.m
--- a/inst/fitscalingrank.m Tue Jun 18 17:40:36 2013 +0100
+++ b/inst/fitscalingrank.m Wed Aug 28 16:28:28 2013 -0400
@@ -23,8 +23,8 @@
#ranks ([7,2,2]) == [3.0,1.5,1.5]
#is [3,1,2] (or [3,2,1]) useful?
expectation_wo_nParents(1, 1:nr_scores) = arrayfun (@(n) 1 / sqrt (n), r);
- expectation(1, 1:nr_scores) = \
- (nParents / sum (expectation_wo_nParents)) * \
+ expectation(1, 1:nr_scores) = ...
+ (nParents / sum (expectation_wo_nParents)) * ...
expectation_wo_nParents;
endfunction
diff -r 6f794cc0f9b1 -r 48d6211f8f36 inst/ga.m
--- a/inst/ga.m Tue Jun 18 17:40:36 2013 +0100
+++ b/inst/ga.m Wed Aug 28 16:28:28 2013 -0400
@@ -73,7 +73,7 @@
## Author: Luca Favatella <slackydeb@gmail.com>
## Version: 6.0.1
-function [x fval exitflag output population scores] = \
+function [x fval exitflag output population scores] = ...
ga (fitnessfcn_or_problem,
nvars,
A = [], b = [],
diff -r 6f794cc0f9b1 -r 48d6211f8f36 inst/gacreationuniform.m
--- a/inst/gacreationuniform.m Tue Jun 18 17:40:36 2013 +0100
+++ b/inst/gacreationuniform.m Wed Aug 28 16:28:28 2013 -0400
@@ -40,15 +40,15 @@
## Version: 4.9
function Population = gacreationuniform (GenomeLength, FitnessFcn, options)
- [LB(1, 1:GenomeLength) UB(1, 1:GenomeLength)] = \
+ [LB(1, 1:GenomeLength) UB(1, 1:GenomeLength)] = ...
__ga_popinitrange__ (options.PopInitRange, GenomeLength);
## pseudocode
##
## Population = Delta * RandomPopulationBetween0And1 + Offset
- Population(1:options.PopulationSize, 1:GenomeLength) = \
- ((ones (options.PopulationSize, 1) * (UB - LB)) .* \
- rand (options.PopulationSize, GenomeLength)) + \
+ Population(1:options.PopulationSize, 1:GenomeLength) = ...
+ ((ones (options.PopulationSize, 1) * (UB - LB)) .* ...
+ rand (options.PopulationSize, GenomeLength)) + ...
(ones (options.PopulationSize, 1) * LB);
endfunction
diff -r 6f794cc0f9b1 -r 48d6211f8f36 inst/mutationgaussian.m
--- a/inst/mutationgaussian.m Tue Jun 18 17:40:36 2013 +0100
+++ b/inst/mutationgaussian.m Wed Aug 28 16:28:28 2013 -0400
@@ -16,11 +16,11 @@
## Author: Luca Favatella <slackydeb@gmail.com>
## Version: 1.7.1
-function mutationChildren = \
+function mutationChildren = ...
mutationgaussian (parents, options, nvars, FitnessFcn,
state, thisScore,
thisPopulation)
- [LB(1, 1:nvars) UB(1, 1:nvars)] = \
+ [LB(1, 1:nvars) UB(1, 1:nvars)] = ...
__ga_popinitrange__ (options.PopInitRange, nvars);
## start mutationgaussian logic
@@ -38,12 +38,12 @@
endfor
current_std(1, 1:nvars) = tmp_std;
nc_parents = columns (parents);
- expanded_current_std(1:nc_parents, 1:nvars) = \
+ expanded_current_std(1:nc_parents, 1:nvars) = ...
ones (nc_parents, 1) * current_std;
## finally add random numbers
- mutationChildren(1:nc_parents, 1:nvars) = \
- thisPopulation(parents(1, 1:nc_parents), 1:nvars) + \
+ mutationChildren(1:nc_parents, 1:nvars) = ...
+ thisPopulation(parents(1, 1:nc_parents), 1:nvars) + ...
expanded_current_std .* randn (nc_parents, nvars);
endfunction
|