octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #65186] potential regression due to "isargout"


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #65186] potential regression due to "isargout" changes
Date: Sat, 20 Jan 2024 16:19:22 -0500 (EST)

Follow-up Comment #1, bug#65186 (group octave):

As I wrote in the discourse thread:

OK, I think that is because of this change:


diff --git a/scripts/optimization/fminsearch.m
b/scripts/optimization/fminsearch.m
--- a/scripts/optimization/fminsearch.m
+++ b/scripts/optimization/fminsearch.m
@@ -178,7 +178,7 @@ function [x, fval, exitflag, output] = f
 
   [x, exitflag, output] = nmsmax (fcn, x0, options, varargin{:});
 
-  if (isargout (2))
+  if (nargout > 1)
     fval = feval (fcn, x);
   endif


With the previous code, if isargout(2) returned false, this code work
“work”. But it seems wrong for fminsearch to be calling the objective
function without the extra data parameter. Shouldn’t it always pass that
info consistently?


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65186>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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