From: <i7...@us...> - 2010-11-11 11:46:00
|
Revision: 7908 http://octave.svn.sourceforge.net/octave/?rev=7908&view=rev Author: i7tiol Date: 2010-11-11 11:45:54 +0000 (Thu, 11 Nov 2010) Log Message: ----------- Fix __dfdp__.m called with less than 3 arguments. 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 2010-11-10 08:46:34 UTC (rev 7907) +++ trunk/octave-forge/main/optim/DESCRIPTION 2010-11-11 11:45:54 UTC (rev 7908) @@ -1,6 +1,6 @@ Name: Optim -Version: 1.0.15 -Date: 2010-10-25 +Version: 1.0.16 +Date: 2010-11-05 Author: Various Authors Maintainer: The Octave Community Title: Optimzation. Modified: trunk/octave-forge/main/optim/inst/__dfdp__.m =================================================================== --- trunk/octave-forge/main/optim/inst/__dfdp__.m 2010-11-10 08:46:34 UTC (rev 7907) +++ trunk/octave-forge/main/optim/inst/__dfdp__.m 2010-11-11 11:45:54 UTC (rev 7908) @@ -72,6 +72,7 @@ bounds = ones (n, 2); bounds(:, 1) = -Inf; bounds(:, 2) = Inf; + plabels = 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 2010-11-10 08:46:34 UTC (rev 7907) +++ trunk/octave-forge/main/optim/inst/__nonlin_residmin__.m 2010-11-11 11:45:54 UTC (rev 7908) @@ -122,6 +122,9 @@ endif else pord = pord(:); + if (rows (unique (pord)) < rows (pord)) + error ("duplicate parameter names in 'param_order'"); + endif endif if (! pin_struct) @@ -333,12 +336,24 @@ ## linear inequality constraints if (mc_struct) - mc = cat (1, fields2cell (mc, pord){:}); + idx = arefields (mc, pord); + if (rows (fieldnames (mc)) > sum (idx)) + error ("unknown fields in structure of linear inequality constraints"); + endif + smc = mc; + mc = zeros (np, rows (vc)); + mc(idx, :) = cat (1, fields2cell (smc, pord(idx)){:}); endif ## linear equality constraints if (emc_struct) - emc = cat (1, fields2cell (emc, pord){:}); + idx = arefields (emc, pord); + if (rows (fieldnames (emc)) > sum (idx)) + error ("unknown fields in structure of linear equality constraints"); + endif + semc = emc; + emc = zeros (np, rowd (evc)); + emc(idx, :) = cat (1, fields2cell (semc, pord(idx)){:}); endif ## parameter-related configuration for jacobi functions Modified: trunk/octave-forge/main/optim/inst/nonlin_residmin.m =================================================================== --- trunk/octave-forge/main/optim/inst/nonlin_residmin.m 2010-11-10 08:46:34 UTC (rev 7907) +++ trunk/octave-forge/main/optim/inst/nonlin_residmin.m 2010-11-11 11:45:54 UTC (rev 7908) @@ -197,6 +197,7 @@ ## Similarly, for specifying linear constraints, instead of the matrix ## (called @code{m} above), a structure containing the rows of the ## matrix in fields under the respective parameter names can be given. +## In this case, rows containing only zeros need not be given. ## ## The vector/matrix-based settings @code{bounds}, @code{fixed}, ## @code{diffp}, @code{diff_onesided}, @code{fract_prec}, and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |