From: <i7...@us...> - 2011-05-20 09:52:46
|
Revision: 8274 http://octave.svn.sourceforge.net/octave/?rev=8274&view=rev Author: i7tiol Date: 2011-05-20 09:52:37 +0000 (Fri, 20 May 2011) Log Message: ----------- Replace function calls: cell2cell -> num2cell, partarray -> mat2cell. Modified Paths: -------------- trunk/octave-forge/main/optim/DESCRIPTION trunk/octave-forge/main/optim/inst/__dfdp__.m trunk/octave-forge/main/optim/inst/__nonlin_residmin__.m trunk/octave-forge/main/optim/inst/nonlin_residmin.m Modified: trunk/octave-forge/main/optim/DESCRIPTION =================================================================== --- trunk/octave-forge/main/optim/DESCRIPTION 2011-05-20 07:45:05 UTC (rev 8273) +++ trunk/octave-forge/main/optim/DESCRIPTION 2011-05-20 09:52:37 UTC (rev 8274) @@ -1,11 +1,11 @@ Name: Optim Version: 1.0.17 -Date: 2011-03-07 +Date: 2011-05-20 Author: Various Authors Maintainer: The Octave Community Title: Optimzation. Description: Non-linear optimization toolkit. -Depends: octave (>= 2.9.7), miscellaneous (>= 1.0.11), struct (>= 1.0.9) +Depends: octave (>= 2.9.7), miscellaneous (>= 1.0.10), struct (>= 1.0.9) Autoload: yes License: GPL version 2 or later and GFDL Url: http://octave.sf.net Modified: trunk/octave-forge/main/optim/inst/__dfdp__.m =================================================================== --- trunk/octave-forge/main/optim/inst/__dfdp__.m 2011-05-20 07:45:05 UTC (rev 8273) +++ trunk/octave-forge/main/optim/inst/__dfdp__.m 2011-05-20 09:52:37 UTC (rev 8274) @@ -66,7 +66,7 @@ if (isfield (hook, 'plabels')) plabels = hook.plabels; else - plabels = cell2cell (num2cell ((1:n).'), 1); + plabels = num2cell (num2cell ((1:n).')); end else @@ -75,7 +75,7 @@ diffp = .001 * ones (n, 1); lbound = - Inf (n, 1); ubound = Inf (n, 1); - plabels = cell2cell (num2cell ((1:n).'), 1); + plabels = num2cell (num2cell ((1:n).')); end prt = zeros (m, n); % initialise Jacobian to Zero Modified: trunk/octave-forge/main/optim/inst/__nonlin_residmin__.m =================================================================== --- trunk/octave-forge/main/optim/inst/__nonlin_residmin__.m 2011-05-20 07:45:05 UTC (rev 8273) +++ trunk/octave-forge/main/optim/inst/__nonlin_residmin__.m 2011-05-20 09:52:37 UTC (rev 8274) @@ -178,8 +178,7 @@ error ("lengths of 'param_order' and 'param_dims' not equal"); endif pnel = cellfun (@ prod, pdims); - ppartidx = cumsum (pnel); - ppartidx = [[1; ppartidx(1:end-1)+1], ppartidx]; + ppartidx = pnel; if (any (pnel > 1)) pnonscalar = true; cpnel = num2cell (pnel); @@ -210,10 +209,10 @@ endif endif - plabels = cell2cell (num2cell ((1:np).'), 1); + plabels = num2cell (num2cell ((1:np).')); if (! isempty (pord)) - plabels = cat (2, plabels, cell2cell (epord, 1), \ - cell2cell (num2cell (psubidx), 1)); + plabels = cat (2, plabels, num2cell (epord), \ + num2cell (num2cell (psubidx))); endif ## some useful vectors @@ -422,7 +421,7 @@ if (pnonscalar) f = @ (p, varargin) \ f (cell2struct \ - (cellfun (@ reshape, partarray (p, ppartidx), \ + (cellfun (@ reshape, mat2cell (p, ppartidx), \ pdims, "UniformOutput", false), \ pord, 1), varargin{:}); else @@ -449,7 +448,7 @@ cat (2, \ fields2cell \ (dfdp (cell2struct \ - (cellfun (@ reshape, partarray (p, ppartidx), \ + (cellfun (@ reshape, mat2cell (p, ppartidx), \ pdims, "UniformOutput", false), \ pord, 1), hook), \ pord){:}); @@ -467,7 +466,7 @@ if (pnonscalar) f_genicstr = @ (p, varargin) \ f_genicstr (cell2struct \ - (cellfun (@ reshape, partarray (p, ppartidx), \ + (cellfun (@ reshape, mat2cell (p, ppartidx), \ pdims, "UniformOutput", false), \ pord, 1), varargin{:}); else @@ -488,7 +487,7 @@ fields2cell \ (df_gencstr \ (cell2struct \ - (cellfun (@ reshape, partarray (p, ppartidx), \ + (cellfun (@ reshape, mat2cell (p, ppartidx), \ pdims, "UniformOutput", false), pord, 1), \ func, idx, hook), \ pord){:}); @@ -507,7 +506,7 @@ if (pnonscalar) f_genecstr = @ (p, varargin) \ f_genecstr (cell2struct \ - (cellfun (@ reshape, partarray (p, ppartidx), \ + (cellfun (@ reshape, mat2cell (p, ppartidx), \ pdims, "UniformOutput", false), \ pord, 1), varargin{:}); else @@ -528,7 +527,7 @@ fields2cell \ (df_genecstr \ (cell2struct \ - (cellfun (@ reshape, partarray (p, ppartidx), \ + (cellfun (@ reshape, mat2cell (p, ppartidx), \ pdims, "UniformOutput", false), pord, 1), \ func, idx, hook), \ pord){:}); @@ -564,40 +563,39 @@ emc(idx(prepidx), :) = cat (1, fields2cell (semc, pord(idx)){:}); endif - ## parameter-related configuration for jacobi functions + ## parameter-related configuration for jacobian functions if (dfdp_pstruct || df_inequc_pstruct || df_equc_pstruct) if(pnonscalar) s_diffp = cell2struct \ - (cellfun (@ reshape, partarray (diffp, ppartidx), \ + (cellfun (@ reshape, mat2cell (diffp, ppartidx), \ pdims, "UniformOutput", false), pord, 1); s_diff_onesided = cell2struct \ - (cellfun (@ reshape, partarray (diff_onesided, ppartidx), \ + (cellfun (@ reshape, mat2cell (diff_onesided, ppartidx), \ pdims, "UniformOutput", false), pord, 1); s_orig_lbound = cell2struct \ - (cellfun (@ reshape, partarray (lbound, ppartidx), \ + (cellfun (@ reshape, mat2cell (lbound, ppartidx), \ pdims, "UniformOutput", false), pord, 1); s_orig_ubound = cell2struct \ - (cellfun (@ reshape, partarray (ubound, ppartidx), \ + (cellfun (@ reshape, mat2cell (ubound, ppartidx), \ pdims, "UniformOutput", false), pord, 1); s_plabels = cell2struct \ - (cell2cell \ + (num2cell \ (cat (2, cellfun \ (@ (x) cellfun \ - (@ reshape, partarray (cat (1, x{:}), ppartidx), \ + (@ reshape, mat2cell (cat (1, x{:}), ppartidx), \ pdims, "UniformOutput", false), \ - cell2cell (plabels, 2), "UniformOutput", false){:}), \ - 1), \ + num2cell (plabels, 1), "UniformOutput", false){:}), \ + 2), \ pord, 1); - s_plabels = cell2struct (cell2cell (plabels, 1), pord, 1); s_orig_fixed = cell2struct \ - (cellfun (@ reshape, partarray (fixed, ppartidx), \ + (cellfun (@ reshape, mat2cell (fixed, ppartidx), \ pdims, "UniformOutput", false), pord, 1); else s_diffp = cell2struct (num2cell (diffp), pord, 1); s_diff_onesided = cell2struct (num2cell (diff_onesided), pord, 1); s_orig_lbound = cell2struct (num2cell (lbound), pord, 1); s_orig_ubound = cell2struct (num2cell (ubound), pord, 1); - s_plabels = cell2struct (cell2cell (plabels, 1), pord, 1); + s_plabels = cell2struct (num2cell (plabels, 2), pord, 1); s_orig_fixed = cell2struct (num2cell (fixed), pord, 1); endif endif @@ -913,7 +911,7 @@ if (pin_struct) if (pnonscalar) p = cell2struct \ - (cellfun (@ reshape, partarray (p, ppartidx), \ + (cellfun (@ reshape, mat2cell (p, ppartidx), \ pdims, "UniformOutput", false), \ pord, 1); else Modified: trunk/octave-forge/main/optim/inst/nonlin_residmin.m =================================================================== --- trunk/octave-forge/main/optim/inst/nonlin_residmin.m 2011-05-20 07:45:05 UTC (rev 8273) +++ trunk/octave-forge/main/optim/inst/nonlin_residmin.m 2011-05-20 09:52:37 UTC (rev 8274) @@ -174,9 +174,10 @@ ## ## The setting @code{param_order} is a cell-array with names of the ## optimized parameters. If not given, and initial parameters are a -## structure, all parameters in the structure are optimized. It is an -## error if @code{param_order} is not given and there are any -## non-structure-based configuration items or functions. +## structure, all parameters in the structure are optimized. If initial +## parameters are a structure, it is an error if @code{param_order} is +## not given and there are any non-structure-based configuration items +## or functions. ## ## The initial parameters @var{pin} can be given as a structure ## containing at least all fields named in @code{param_order}. In this This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |