changeset 11613:e4cb1c2c39c4 octave-forge

Fix for functions of >2 variables, reported by Hershal.
author i7tiol
date Mon, 08 Apr 2013 11:52:52 +0000
parents 425a955ad336
children 672c998c6620
files main/optim/DESCRIPTION main/optim/NEWS main/optim/inst/jacobs.m
diffstat 3 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/main/optim/DESCRIPTION	Mon Apr 08 05:24:18 2013 +0000
+++ b/main/optim/DESCRIPTION	Mon Apr 08 11:52:52 2013 +0000
@@ -1,6 +1,6 @@
 Name: Optim
 Version: 1.2.2
-Date: 2012-11-04
+Date: 2013-04-08
 Author: various authors
 Maintainer: Octave-Forge community <octave-dev@lists.sourceforge.net>
 Title: Optimization.
--- a/main/optim/NEWS	Mon Apr 08 05:24:18 2013 +0000
+++ b/main/optim/NEWS	Mon Apr 08 11:52:52 2013 +0000
@@ -1,3 +1,5 @@
+ ** Bugfix in jacobs for functions of more than 2 variables.
+
 optim 1.2.2:
 ------------
 
--- a/main/optim/inst/jacobs.m	Mon Apr 08 05:24:18 2013 +0000
+++ b/main/optim/inst/jacobs.m	Mon Apr 08 11:52:52 2013 +0000
@@ -82,7 +82,7 @@
       if (numel (hook.fixed) != n)
         error ("index of fixed parameters has wrong dimensions");
       endif
-      fixed = hook.fixed;
+      fixed = hook.fixed(:);
     else
       fixed = false (n, 1);
     endif
@@ -100,7 +100,7 @@
 
   x = repmat (x(:), 1, n) + h * 1i * eye (n);
 
-  idx = find (! fixed);
+  idx = find (! fixed).';
 
   ## after first evaluation, dimensionness of 'f' is known
   t_Df = imag (f (x(:, idx(1)))(:));