changeset 31267:3c504176e546

maint: Merge stable to default
author Arun Giridhar <arungiridhar@gmail.com>
date Thu, 06 Oct 2022 19:56:02 -0400
parents c332a2f2959f (current diff) e5e35410da90 (diff)
children 72744e659510
files
diffstat 2 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/optimization/lsqnonneg.m	Thu Oct 06 16:36:29 2022 -0400
+++ b/scripts/optimization/lsqnonneg.m	Thu Oct 06 19:56:02 2022 -0400
@@ -69,8 +69,10 @@
 ## @end itemize
 ##
 ## @item lambda
-## @c FIXME: Something is output from the function, but what is it?
-## Undocumented output
+## Conjugate gradient at the converged point.  Zero elements are usually
+## abutting coordinate planes.  Negative elements are stable to small
+## perturbations.
+##
 ## @end table
 ## @seealso{pqpnonneg, lscov, optimset}
 ## @end deftypefn
@@ -219,6 +221,11 @@
   if (isargout (6))
     lambda = zeros (size (x));
     lambda(p) = w;
+    ## FIXME: The above line errors when the solution is NOT constrained
+    ## by non-negativity!  That case happens when the lsqnonneg solution
+    ## is the same as the fminunc solution.  Ideally the user would not
+    ## be using lsqnonneg if nonnegativity constraints are not active, but we
+    ## should handle that more gracefully.
   endif
 
 endfunction
--- a/scripts/optimization/pqpnonneg.m	Thu Oct 06 16:36:29 2022 -0400
+++ b/scripts/optimization/pqpnonneg.m	Thu Oct 06 19:56:02 2022 -0400
@@ -71,8 +71,10 @@
 ## @end itemize
 ##
 ## @item lambda
-## @c FIXME: Something is output from the function, but what is it?
-## Undocumented output
+## Conjugate gradient at the converged point.  Zero elements are usually
+## abutting coordinate planes.  Negative elements are stable to small
+## perturbations.
+##
 ## @end table
 ## @seealso{lsqnonneg, qp, optimset}
 ## @end deftypefn
@@ -223,6 +225,11 @@
   if (isargout (5))
     lambda = zeros (size (x));
     lambda(p) = w;
+    ## FIXME: The above line errors when the solution is NOT constrained
+    ## by non-negativity!  That case happens when the lsqnonneg solution
+    ## is the same as the fminunc solution.  Ideally the user would not
+    ## be using lsqnonneg if nonnegativity constraints are not active, but we
+    ## should handle that more gracefully.
   endif
 
 endfunction