octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

optimset/optimget


From: John W. Eaton
Subject: optimset/optimget
Date: Mon, 26 Jan 2009 14:29:10 -0500

I see you checked in this change:

  http://hg.savannah.gnu.org/hgweb/octave/rev/ffc9e9737507

Without something like this, how do you propose to handle calls like

  optimset ("fsolve")
  optimset ("leasqr")

which are supposed to return the set of options relevant to the named
function.  I think the solution of putting this information in a
separate file is better than embedding it in the optimset function
because it allows anyone to extend optimset to handle their new
optimization function which requires uses new/extra options.

Also, whether or not you decide to remove the __*_defopts__ functions,
I think we should make a change like this so that optimset and
optimget are not case sensitive.

jwe


diff --git a/scripts/optimization/optimget.m b/scripts/optimization/optimget.m
--- a/scripts/optimization/optimget.m
+++ b/scripts/optimization/optimget.m
@@ -28,7 +28,7 @@
 function retval = optimget (options, parname, default)
 
   if (isfield (options, parname))
-    retval = options.(parname);
+    retval = options.(tolower (parname));
   elseif (nargin > 2)
     retval = default;
   else
diff --git a/scripts/optimization/optimset.m b/scripts/optimization/optimset.m
--- a/scripts/optimization/optimset.m
+++ b/scripts/optimization/optimset.m
@@ -30,13 +30,13 @@
 
   ## Add more as needed.
   persistent opts = {
-    "Display", "\"off\"|\"iter\"|{\"final\"}|\"notify\"";
-    "FunValCheck", "{\"off\"}|\"on\"";
-    "MaxFunEvals", "positive integer";
-    "MaxIter", "positive integer";
-    "OutputFun", "function|{[]}";
-    "TolFun", "positive scalar";
-    "TolX", "positive scalar"
+    "display", "\"off\"|\"iter\"|{\"final\"}|\"notify\"";
+    "funvalcheck", "{\"off\"}|\"on\"";
+    "maxfunevals", "positive integer";
+    "maxiter", "positive integer";
+    "outputfun", "function|{[]}";
+    "tolfun", "positive scalar";
+    "tolx", "positive scalar"
   };
 
   if (nargs == 0)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]