From: <mc...@us...> - 2008-05-19 14:09:37
|
Revision: 5069 http://octave.svn.sourceforge.net/octave/?rev=5069&view=rev Author: mcreel Date: 2008-05-19 07:08:42 -0700 (Mon, 19 May 2008) Log Message: ----------- clean up isstr and is_vector warnings, simplify examples Modified Paths: -------------- trunk/octave-forge/main/optim/inst/bfgsmin.m trunk/octave-forge/main/optim/inst/bfgsmin_example.m Modified: trunk/octave-forge/main/optim/inst/bfgsmin.m =================================================================== --- trunk/octave-forge/main/optim/inst/bfgsmin.m 2008-05-19 05:53:06 UTC (rev 5068) +++ trunk/octave-forge/main/optim/inst/bfgsmin.m 2008-05-19 14:08:42 UTC (rev 5069) @@ -11,7 +11,8 @@ ## 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/>. +## along with this program; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## bfgsmin: bfgs or limited memory bfgs minimization of function ## @@ -62,7 +63,7 @@ if ((nargin < 2) || (nargin > 3)) usage("bfgsmin: you must supply 2 or 3 arguments"); endif - if (!isstr(f)) usage("bfgsmin: first argument must be string holding objective function name"); endif + if (!ischar(f)) usage("bfgsmin: first argument must be string holding objective function name"); endif if (!iscell(f_args)) usage("bfgsmin: second argument must cell array of function arguments"); endif if (nargin > 2) if (!iscell(control)) @@ -122,7 +123,7 @@ minarg = control{4}; theta = f_args{minarg}; theta = theta(:); - if (!is_vector(theta)) usage("bfgsmin: minimization must be done with respect to a vector of parameters"); endif + if (!isvector(theta)) usage("bfgsmin: minimization must be done with respect to a vector of parameters"); endif f_args{minarg} = theta; # now go ahead and do the minimization Modified: trunk/octave-forge/main/optim/inst/bfgsmin_example.m =================================================================== --- trunk/octave-forge/main/optim/inst/bfgsmin_example.m 2008-05-19 05:53:06 UTC (rev 5068) +++ trunk/octave-forge/main/optim/inst/bfgsmin_example.m 2008-05-19 14:08:42 UTC (rev 5069) @@ -11,7 +11,8 @@ # 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/>. +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # usage: bfgsmin_example (to run) or edit bfgsmin_example (to examine) ## @@ -42,7 +43,7 @@ endfunction # initial values -dim = 20; # dimension of Rosenbrock function +dim = 10; # dimension of Rosenbrock function theta0 = zeros(dim+1,1); # starting values location = (0:dim)/dim; # true values location = location'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |