From: <car...@us...> - 2012-03-30 11:56:35
|
Revision: 10111 http://octave.svn.sourceforge.net/octave/?rev=10111&view=rev Author: carandraug Date: 2012-03-30 11:56:24 +0000 (Fri, 30 Mar 2012) Log Message: ----------- optim: mention deprecated functions on NEWS and make warning appear only once per session Modified Paths: -------------- trunk/octave-forge/main/optim/NEWS trunk/octave-forge/main/optim/inst/fminunc_compat.m trunk/octave-forge/main/optim/inst/optimset_compat.m Modified: trunk/octave-forge/main/optim/NEWS =================================================================== --- trunk/octave-forge/main/optim/NEWS 2012-03-30 11:10:16 UTC (rev 10110) +++ trunk/octave-forge/main/optim/NEWS 2012-03-30 11:56:24 UTC (rev 10111) @@ -1,6 +1,9 @@ -Summary of important user-visible changes for optim 1.0.18: +Summary of important user-visible changes for optim 1.1.0: ------------------------------------------------------------------- - ** The package makefile has been adapted for compatibility with Octave 3.6.0. + ** The following functions have been deprecated since they have been + implemented in Octave core: - ** There is now a 'NEWS' file. + fminunc_compat optimset_compat + + ** The package Makefile has been adapted for compatibility with Octave 3.6.0. Modified: trunk/octave-forge/main/optim/inst/fminunc_compat.m =================================================================== --- trunk/octave-forge/main/optim/inst/fminunc_compat.m 2012-03-30 11:10:16 UTC (rev 10110) +++ trunk/octave-forge/main/optim/inst/fminunc_compat.m 2012-03-30 11:56:24 UTC (rev 10111) @@ -42,9 +42,15 @@ ## the 'backend' option of minimize(). ## ## This function is a front-end to minimize(). + function [x,fval,flag,out,df,d2f] = fminunc_compat (fun,x0,opt,varargin) - warning ("'fminunc_compat' has been deprecated in favor of 'fminunc', which is now part of core Octave. This function will possibly be removed from future versions of the 'optim' package."); + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "`fminunc_compat' has been deprecated, and will be removed in the future. Use `fminunc' from Octave core instead."); + endif if nargin < 3, opt = struct (); end if nargin > 3, Modified: trunk/octave-forge/main/optim/inst/optimset_compat.m =================================================================== --- trunk/octave-forge/main/optim/inst/optimset_compat.m 2012-03-30 11:10:16 UTC (rev 10110) +++ trunk/octave-forge/main/optim/inst/optimset_compat.m 2012-03-30 11:56:24 UTC (rev 10111) @@ -41,7 +41,12 @@ ## Display , ["off","iter","notify","final"] ## : N/A - warning ("'optimset_compat' has been deprecated in favor of 'optimset', which is now part of core Octave. This function will possibly be removed from future versions of the 'optim' package."); + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "`optimset_compat' has been deprecated, and will be removed in the future. Use `optimset' from Octave core instead."); + endif args = varargin; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |