changeset 9968:7cb2f7e7c6d8 octave-forge

fmin: deprecating in favour of fminbnd
author carandraug
date Thu, 05 Apr 2012 21:45:17 +0000
parents 4752826dd5e0
children 61fd3fff43c1
files main/optim/NEWS main/optim/inst/fmin.m
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/main/optim/NEWS	Thu Apr 05 19:26:23 2012 +0000
+++ b/main/optim/NEWS	Thu Apr 05 21:45:17 2012 +0000
@@ -10,6 +10,13 @@
 
       fminunc_compat  optimset_compat
 
+ ** The function `fmin' has been deprecated in favour of using `fminbnd'
+    directly. If one really wishes to use the short version, one can
+    easily create an alias on an octaverc file (see `doc startup') with
+    the following code
+
+      function out=fmin(varargin) out=fminbnd(varargin{:}); endfunction
+
  ** The package Makefile has been adapted for compatibility with Octave 3.6.0.
 
  ** Bugfixes on the functions:
--- a/main/optim/inst/fmin.m	Thu Apr 05 19:26:23 2012 +0000
+++ b/main/optim/inst/fmin.m	Thu Apr 05 21:45:17 2012 +0000
@@ -15,6 +15,13 @@
 
 function ret=fmin(varargin)
 
+  persistent warned = false;
+  if (! warned)
+    warned = true;
+    warning ("Octave:deprecated-function",
+             "`fmin' has been deprecated, and will be removed in the future. Use `fminbnd' directly instead.");
+  endif
+
   ## alias for fminbnd
   ret = fminbnd(varargin{:});