From: <sla...@us...> - 2008-08-16 18:14:10
|
Revision: 5245 http://octave.svn.sourceforge.net/octave/?rev=5245&view=rev Author: slackydeb Date: 2008-08-16 18:14:17 +0000 (Sat, 16 Aug 2008) Log Message: ----------- integrate most debug asserts as matrix indices or tests; clean and modularize code; little performance improvement in __ga_problem__ function; little fixes Modified Paths: -------------- trunk/octave-forge/main/ga/DESCRIPTION trunk/octave-forge/main/ga/inst/__ga_crossoverfcn__.m trunk/octave-forge/main/ga/inst/__ga_initial_population__.m trunk/octave-forge/main/ga/inst/__ga_mutationfcn__.m trunk/octave-forge/main/ga/inst/__ga_problem__.m trunk/octave-forge/main/ga/inst/__ga_problem_private_state__.m trunk/octave-forge/main/ga/inst/__ga_problem_state_selection__.m trunk/octave-forge/main/ga/inst/__ga_scores__.m trunk/octave-forge/main/ga/inst/__ga_selectionfcn__.m trunk/octave-forge/main/ga/inst/__gaoptimset_default_options__.m trunk/octave-forge/main/ga/inst/crossoverscattered.m trunk/octave-forge/main/ga/inst/fitscalingrank.m trunk/octave-forge/main/ga/inst/ga.m trunk/octave-forge/main/ga/inst/gacreationuniform.m trunk/octave-forge/main/ga/inst/gaoptimset.m trunk/octave-forge/main/ga/inst/mutationgaussian.m Added Paths: ----------- trunk/octave-forge/main/ga/inst/__ga_popinitrange__.m Modified: trunk/octave-forge/main/ga/DESCRIPTION =================================================================== --- trunk/octave-forge/main/ga/DESCRIPTION 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/DESCRIPTION 2008-08-16 18:14:17 UTC (rev 5245) @@ -1,5 +1,5 @@ Name: ga -Version: 0.9.1 +Version: 0.9.2 Date: 2008-08-16 Author: Luca Favatella <sla...@gm...> Maintainer: Luca Favatella <sla...@gm...> Modified: trunk/octave-forge/main/ga/inst/__ga_crossoverfcn__.m =================================================================== --- trunk/octave-forge/main/ga/inst/__ga_crossoverfcn__.m 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/inst/__ga_crossoverfcn__.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -14,22 +14,20 @@ ## along with this program; If not, see <http://www.gnu.org/licenses/>. ## Author: Luca Favatella <sla...@gm...> -## Version: 1.2 +## Version: 1.3.3 function xoverKids = __ga_crossoverfcn__ (parents, options, nvars, FitnessFcn, unused, thisPopulation) ## preconditions - [nr_parents nc_parents] = size (parents); - assert (nr_parents, 1); ## DEBUG - assert (rem (nc_parents, 2), 0); ## DEBUG - assert (columns (thisPopulation), nvars); ## DEBUG + nc_parents = columns (parents); + if (rem (nc_parents, 2) != 0) + error ("'parents' must have an even number of columns"); + endif - xoverKids = options.CrossoverFcn (parents, options, nvars, FitnessFcn, - unused, - thisPopulation); - - ## postconditions - assert (size (xoverKids), [(nc_parents / 2) nvars]); ## DEBUG + xoverKids(1:(nc_parents / 2), 1:nvars) = options.CrossoverFcn \ + (parents(1, 1:nc_parents), options, nvars, FitnessFcn, + unused, + thisPopulation(:, 1:nvars)); endfunction \ No newline at end of file Modified: trunk/octave-forge/main/ga/inst/__ga_initial_population__.m =================================================================== --- trunk/octave-forge/main/ga/inst/__ga_initial_population__.m 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/inst/__ga_initial_population__.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -21,38 +21,37 @@ ## @end deftypefn ## Author: Luca Favatella <sla...@gm...> -## Version: 3.2 +## Version: 3.2.4 #TODO consider PopulationSize as a #vector for multiple subpopolations function Population = \ __ga_initial_population__ (GenomeLength, FitnessFcn, options) - [nr nc] = size (options.InitialPopulation); - if ((nr == 0) || (nc == 0)) + [nrInitialPopulation ncInitialPopulation] = size (options.InitialPopulation); + + if (isempty (options.InitialPopulation)) Population(1:options.PopulationSize, 1:GenomeLength) = \ options.CreationFcn (GenomeLength, FitnessFcn, options); - elseif (nc == GenomeLength) + elseif (ncInitialPopulation == GenomeLength) ## nrInitialPopulation > 0 + if (nrInitialPopulation < options.PopulationSize) - ## nr > 0 - if (nr < options.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) = \ options.CreationFcn (GenomeLength, FitnessFcn, options); + Population(1:options.PopulationSize, 1:GenomeLength) = vertcat \ + (options.InitialPopulation(1:nr, 1:GenomeLength), + CreatedPopulation(1:(options.PopulationSize - nrInitialPopulation), + 1:GenomeLength)); + elseif (nrInitialPopulation == options.PopulationSize) Population(1:options.PopulationSize, 1:GenomeLength) = \ - vertcat (options.InitialPopulation(1:nr, 1:GenomeLength), - CreatedPopulation(1:(options.PopulationSize - nr), - 1:GenomeLength)); - elseif (nr == options.PopulationSize) - Population(1:options.PopulationSize, 1:GenomeLength) = \ options.InitialPopulation; - else ## nr > options.PopulationSize + else ## nrInitialPopulation > options.PopulationSize error ("nonempty 'InitialPopulation' must have no more than \ 'PopulationSize' rows"); endif - else ## (nc != 0) && (nc != GenomeLength) + else ## (ncInitialPopulation != 0) && (ncInitialPopulation != GenomeLength) error ("nonempty 'InitialPopulation' must have 'GenomeLength' \ columns"); endif Modified: trunk/octave-forge/main/ga/inst/__ga_mutationfcn__.m =================================================================== --- trunk/octave-forge/main/ga/inst/__ga_mutationfcn__.m 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/inst/__ga_mutationfcn__.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -14,21 +14,12 @@ ## along with this program; If not, see <http://www.gnu.org/licenses/>. ## Author: Luca Favatella <sla...@gm...> -## Version: 1.2.1 +## Version: 1.3 function mutationChildren = \ __ga_mutationfcn__ (parents, options, nvars, FitnessFcn, state, thisScore, thisPopulation) - - ## preconditions - #TODO move controls on - #options.PopInitRange in a more general - #function - [nrPopInitRange, ncPopInitRange] = size (options.PopInitRange); - assert (nrPopInitRange, 2); ## DEBUG - assert ((ncPopInitRange == 1) || (ncPopInitRange == nvars)); ## DEBUG - mutationChildren(1:(columns (parents)), 1:nvars) = \ options.MutationFcn{1, 1} (parents(1, :), options, nvars, FitnessFcn, state, thisScore, Added: trunk/octave-forge/main/ga/inst/__ga_popinitrange__.m =================================================================== --- trunk/octave-forge/main/ga/inst/__ga_popinitrange__.m (rev 0) +++ trunk/octave-forge/main/ga/inst/__ga_popinitrange__.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -0,0 +1,28 @@ +## Copyright (C) 2008 Luca Favatella <sla...@gm...> +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; If not, see <http://www.gnu.org/licenses/>. + +## Author: Luca Favatella <sla...@gm...> +## Version: 2.1 + +function [LB UB] = __ga_popinitrange__ (PopInitRange, nvars) + switch (columns (PopInitRange)) + case 1 + tmpPIR(1:2, 1:nvars) = PopInitRange(1:2, 1) * ones (1, nvars); + case nvars + tmpPIR(1:2, 1:nvars) = PopInitRange(1:2, 1:nvars); + endswitch + LB(1, 1:nvars) = tmpPIR(1, 1:nvars); + UB(1, 1:nvars) = tmpPIR(2, 1:nvars); +endfunction \ No newline at end of file Modified: trunk/octave-forge/main/ga/inst/__ga_problem__.m =================================================================== --- trunk/octave-forge/main/ga/inst/__ga_problem__.m 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/inst/__ga_problem__.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -14,7 +14,7 @@ ## along with this program; If not, see <http://www.gnu.org/licenses/>. ## Author: Luca Favatella <sla...@gm...> -## Version: 5.8 +## Version: 5.9 function [x fval exitflag output population scores] = __ga_problem__ (problem) @@ -25,7 +25,7 @@ output = struct ("randstate", rand ("state"), "randnstate", randn ("state")); - ## start "instructions not to be executed at each generation" + ## instructions not to be executed at each generation state.Population(1:problem.options.PopulationSize, 1:problem.nvars) = \ __ga_initial_population__ (problem.nvars, problem.fitnessfcn, @@ -34,13 +34,12 @@ private_state = __ga_problem_private_state__ (problem.options); state.Selection = __ga_problem_state_selection__ (private_state, problem.options); - ## end "instructions not to be executed at each generation" - ## start "instructions to be executed at each generation" + ## instructions to be executed at each generation state = __ga_problem_update_state_at_each_generation__ (state, problem, private_state); - ## end "instructions to be executed at each generation" + NextPopulation = zeros (problem.options.PopulationSize, problem.nvars); while (! __ga_stop__ (problem, state)) ## fix a generation ## elite @@ -50,8 +49,6 @@ state.Population \ (IndexSortedScores(1:private_state.ReproductionCount.elite, 1), 1:problem.nvars); - assert (size (NextPopulation), - [private_state.ReproductionCount.elite, problem.nvars]); ## DEBUG endif ## selection for crossover and mutation @@ -66,10 +63,6 @@ problem.options, problem.nvars, problem.fitnessfcn, false, ## unused state.Population); - tmp = \ - private_state.ReproductionCount.elite + \ - private_state.ReproductionCount.crossover; - assert (size (NextPopulation), [tmp, problem.nvars]); ## DEBUG endif ## mutation @@ -80,14 +73,11 @@ problem.options, problem.nvars, problem.fitnessfcn, state, state.Score, state.Population); - assert (size (NextPopulation), - [problem.options.PopulationSize, problem.nvars]); ## DEBUG endif ## update state structure state.Population(1:problem.options.PopulationSize, 1:problem.nvars) = NextPopulation; - clear -v NextPopulation; state.Generation++; state = __ga_problem_update_state_at_each_generation__ (state, problem, private_state); Modified: trunk/octave-forge/main/ga/inst/__ga_problem_private_state__.m =================================================================== --- trunk/octave-forge/main/ga/inst/__ga_problem_private_state__.m 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/inst/__ga_problem_private_state__.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -14,10 +14,9 @@ ## along with this program; If not, see <http://www.gnu.org/licenses/>. ## Author: Luca Favatella <sla...@gm...> -## Version: 1.1 +## Version: 1.1.1 function private_state = __ga_problem_private_state__ (options) - #start private_state private_state.ReproductionCount.elite = options.EliteCount; private_state.ReproductionCount.crossover = \ fix (options.CrossoverFraction * Modified: trunk/octave-forge/main/ga/inst/__ga_problem_state_selection__.m =================================================================== --- trunk/octave-forge/main/ga/inst/__ga_problem_state_selection__.m 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/inst/__ga_problem_state_selection__.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -14,7 +14,7 @@ ## along with this program; If not, see <http://www.gnu.org/licenses/>. ## Author: Luca Favatella <sla...@gm...> -## Version: 1.1 +## Version: 1.1.1 function Selection = __ga_problem_state_selection__ (private_state, options) Selection.elite = 1:private_state.ReproductionCount.elite; @@ -25,8 +25,8 @@ private_state.ReproductionCount.elite + \ private_state.ReproductionCount.crossover + \ (1:private_state.ReproductionCount.mutation); - assert (length (Selection.elite) + - length (Selection.crossover) + - length (Selection.mutation), - options.PopulationSize); ##DEBUG + #assert (length (Selection.elite) + + # length (Selection.crossover) + + # length (Selection.mutation), + # options.PopulationSize); ##DEBUG endfunction \ No newline at end of file Modified: trunk/octave-forge/main/ga/inst/__ga_scores__.m =================================================================== --- trunk/octave-forge/main/ga/inst/__ga_scores__.m 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/inst/__ga_scores__.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -14,18 +14,18 @@ ## along with this program; If not, see <http://www.gnu.org/licenses/>. ## Author: Luca Favatella <sla...@gm...> -## Version: 5.3 +## Version: 5.3.1 function Scores = __ga_scores__ (fitnessfcn, Population, InitialScores = []) [nrPopulation ncPopulation] = size (Population); [nrInitialScores ncInitialScores] = size (InitialScores); #assert ((ncInitialScores == 0) || (ncInitialScores == 1)); ## DEBUG #assert (nrInitialScores <= nrPopulation); ## DEBUG - if (nrInitialScores > 0) - Scores(1:nrInitialScores, 1) = InitialScores(1:nrInitialScores, 1); + if (! isempty (InitialScores)) + Scores(1:nrInitialScores, 1) = InitialScores; endif for index = (nrInitialScores + 1):nrPopulation Scores(index, 1) = fitnessfcn (Population(index, 1:ncPopulation)); endfor - #assert (size (Scores), [nrPopulation 1]); ## DEBUG + Scores(1:nrPopulation, 1) = Scores; endfunction \ No newline at end of file Modified: trunk/octave-forge/main/ga/inst/__ga_selectionfcn__.m =================================================================== --- trunk/octave-forge/main/ga/inst/__ga_selectionfcn__.m 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/inst/__ga_selectionfcn__.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -14,15 +14,9 @@ ## along with this program; If not, see <http://www.gnu.org/licenses/>. ## Author: Luca Favatella <sla...@gm...> -## Version: 1.1 +## Version: 1.2 function parents = __ga_selectionfcn__ (expectation, nParents, options) - - ## preconditions - assert (rows (expectation), 1); ## DEBUG - - parents = options.SelectionFcn (expectation, nParents, options); - - ## postconditions - assert (size (parents), [1 nParents]); ## DEBUG + parents(1, 1:nParents) = \ + options.SelectionFcn (expectation(1, :), nParents, options); endfunction \ No newline at end of file Modified: trunk/octave-forge/main/ga/inst/__gaoptimset_default_options__.m =================================================================== --- trunk/octave-forge/main/ga/inst/__gaoptimset_default_options__.m 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/inst/__gaoptimset_default_options__.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -14,7 +14,7 @@ ## along with this program; If not, see <http://www.gnu.org/licenses/>. ## Author: Luca Favatella <sla...@gm...> -## Version: 1.2 +## Version: 1.2.1 function default_options = __gaoptimset_default_options__ () default_options.CreationFcn = @gacreationuniform; @@ -42,7 +42,7 @@ #default_options.PlotInterval = 1; default_options.PopInitRange = [0; 1]; default_options.PopulationSize = 20; - default_options.PopulationType = "doubleVector"; + #default_options.PopulationType = "doubleVector"; default_options.SelectionFcn = @selectionstochunif; #default_options.StallGenLimit = 50; #default_options.StallTimeLimit = Inf; Modified: trunk/octave-forge/main/ga/inst/crossoverscattered.m =================================================================== --- trunk/octave-forge/main/ga/inst/crossoverscattered.m 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/inst/crossoverscattered.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -14,18 +14,18 @@ ## along with this program; If not, see <http://www.gnu.org/licenses/>. ## Author: Luca Favatella <sla...@gm...> -## Version: 6.3 +## Version: 6.3.1 function xoverKids = crossoverscattered (parents, options, nvars, FitnessFcn, unused, thisPopulation) - nc_parents = columns (parents); ## simplified example (nvars == 4) ## p1 = [varA varB varC varD] ## p2 = [var1 var2 var3 var4] ## b = [1 1 0 1] ## child1 = [varA varB var3 varD] + nc_parents = columns (parents); n_children = nc_parents / 2; p1(1:n_children, 1:nvars) = \ thisPopulation(parents(1, 1:n_children), 1:nvars); Modified: trunk/octave-forge/main/ga/inst/fitscalingrank.m =================================================================== --- trunk/octave-forge/main/ga/inst/fitscalingrank.m 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/inst/fitscalingrank.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -14,27 +14,30 @@ ## along with this program; If not, see <http://www.gnu.org/licenses/>. ## Author: Luca Favatella <sla...@gm...> -## Version: 1.2 +## Version: 1.3.2 function expectation = fitscalingrank (scores, nParents) - [nr nc] = size (scores); - #assert (nc, 1); ## DEBUG - r(1, 1:nr) = ranks (scores); + nr_scores = rows (scores); + r(1, 1:nr_scores) = ranks (scores(1:nr_scores, 1)); #TODO #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) = arrayfun (@(n) 1 / sqrt (n), r); - expectation(1, 1:nr) = \ + expectation_wo_nParents(1, 1:nr_scores) = arrayfun (@(n) 1 / sqrt (n), r); + expectation(1, 1:nr_scores) = \ (nParents / sum (expectation_wo_nParents)) * \ expectation_wo_nParents; - #assert (sum (expectation), nParents, 1e-9); ## DEBUG +endfunction - ## start DEBUG - #[trash index_min_scores] = min (scores); - #[trash index_max_expectation] = max (expectation); - #assert (index_min_scores, index_max_expectation); - #[trash index_max_scores] = max (scores); - #[trash index_min_expectation] = min (expectation); - #assert (index_max_scores, index_min_expectation); - ## end DEBUG -endfunction \ No newline at end of file +%!shared scores, nParents, expectation +%! scores = rand (20, 1); +%! nParents = 32; +%! expectation = fitscalingrank (scores, nParents); +%!assert (sum (expectation), nParents, 1e-9); +%!test +%! [trash index_min_scores] = min (scores); +%! [trash index_max_expectation] = max (expectation); +%! assert (index_min_scores, index_max_expectation); +%!test +%! [trash index_max_scores] = max (scores); +%! [trash index_min_expectation] = min (expectation); +%! assert (index_max_scores, index_min_expectation); \ No newline at end of file Modified: trunk/octave-forge/main/ga/inst/ga.m =================================================================== --- trunk/octave-forge/main/ga/inst/ga.m 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/inst/ga.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -71,7 +71,7 @@ ## @end deftypefn ## Author: Luca Favatella <sla...@gm...> -## Version: 5.19.1 +## Version: 5.19.2 function [x fval exitflag output population scores] = \ ga (fitnessfcn_or_problem, @@ -90,7 +90,7 @@ print_usage (); else - ## retrieve problem structure + ## retrieve the problem structure if (nargin == 1) problem = fitnessfcn_or_problem; else Modified: trunk/octave-forge/main/ga/inst/gacreationuniform.m =================================================================== --- trunk/octave-forge/main/ga/inst/gacreationuniform.m 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/inst/gacreationuniform.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -37,23 +37,12 @@ ## @end deftypefn ## Author: Luca Favatella <sla...@gm...> -## Version: 4.7.2 +## Version: 4.9 function Population = gacreationuniform (GenomeLength, FitnessFcn, options) + [LB(1, 1:GenomeLength) UB(1, 1:GenomeLength)] = \ + __ga_popinitrange__ (options.PopInitRange, GenomeLength); - ## obtain a 2-by-GenomeLength LocalPopInitRange - switch (columns (options.PopInitRange)) - case 1 - LocalPopInitRange(1:2, 1:GenomeLength) = \ - options.PopInitRange(1:2, 1) * ones (1, GenomeLength); - case GenomeLength - LocalPopInitRange(1:2, 1:GenomeLength) = \ - options.PopInitRange(1:2, 1:GenomeLength); - endswitch - - LB(1, 1:GenomeLength) = LocalPopInitRange(1, 1:GenomeLength); - UB(1, 1:GenomeLength) = LocalPopInitRange(2, 1:GenomeLength); - ## pseudocode ## ## Population = Delta * RandomPopulationBetween0And1 + Offset Modified: trunk/octave-forge/main/ga/inst/gaoptimset.m =================================================================== --- trunk/octave-forge/main/ga/inst/gaoptimset.m 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/inst/gaoptimset.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -47,7 +47,6 @@ ## @item MutationFcn ## @item PopInitRange ## @item PopulationSize -## @item PopulationType ## @item SelectionFcn ## @item TimeLimit ## @end table @@ -56,7 +55,7 @@ ## @end deftypefn ## Author: Luca Favatella <sla...@gm...> -## Version: 4.4 +## Version: 4.4.1 function options = gaoptimset (varargin) if ((nargout != 1) || Modified: trunk/octave-forge/main/ga/inst/mutationgaussian.m =================================================================== --- trunk/octave-forge/main/ga/inst/mutationgaussian.m 2008-08-15 22:47:24 UTC (rev 5244) +++ trunk/octave-forge/main/ga/inst/mutationgaussian.m 2008-08-16 18:14:17 UTC (rev 5245) @@ -14,23 +14,15 @@ ## along with this program; If not, see <http://www.gnu.org/licenses/>. ## Author: Luca Favatella <sla...@gm...> -## Version: 1.5 +## Version: 1.7.1 function mutationChildren = \ mutationgaussian (parents, options, nvars, FitnessFcn, state, thisScore, thisPopulation) - nc_parents = columns (parents); - ncPopInitRange = columns (options.PopInitRange); + [LB(1, 1:nvars) UB(1, 1:nvars)] = \ + __ga_popinitrange__ (options.PopInitRange, nvars); - ## obtain a 2-by-nvars LocalPopInitRange - LocalPopInitRange = options.PopInitRange; - if (ncPopInitRange == 1) - LocalPopInitRange(1:2, 1:nvars) = LocalPopInitRange * ones (1, nvars); - endif - LB(1, 1:nvars) = LocalPopInitRange(1, 1:nvars); - UB(1, 1:nvars) = LocalPopInitRange(2, 1:nvars); - ## start mutationgaussian logic Scale = options.MutationFcn{1, 2}; #assert (size (Scale), [1 1]); ## DEBUG @@ -45,6 +37,7 @@ tmp_std(1, 1:nvars) = (1 - Shrink * (k / options.Generations)) * tmp_std; endfor current_std(1, 1:nvars) = tmp_std; + nc_parents = columns (parents); expanded_current_std(1:nc_parents, 1:nvars) = \ ones (nc_parents, 1) * current_std; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |