fminunc with a one-variable function

Jonathan Stickel jjstickel at vcn.com
Fri Jul 24 12:06:50 CDT 2009


John W. Eaton wrote:
> On 24-Jul-2009, Jonathan Stickel wrote:
> 
> | Jaroslav Hajek wrote:
> | > On Thu, Jul 23, 2009 at 5:32 PM, Jonathan Stickel<jjstickel at vcn.com> wrote:
> | >> I see the following when I use fminunc to minimize a function of just one
> | >> variable:
> | >>
> | >>  function F = theF(x)
> | >>   F = x.^2 + exp(x);
> | >>  endfunction
> | >>  x0 = 1;
> | >>  [xmin,fmin] = fminunc(@theF,x0)
> | >>
> | >> error: Invalid call to cholupdate.  Correct usage is:
> | >>
> | >>  -- Loadable Function: [R1, INFO] = cholupdate (R, U, OP)
> | >>
> | >>
> | >> I know that there are other minimization functions that can be used for
> | >> single-variable functions, but fminunc should work too.
> | >>
> | >> Thanks,
> | >> Jonathan
> | >>
> | > 
> | > Please try
> | > http://hg.savannah.gnu.org/hgweb/octave/rev/5fcf008c7c41
> | > 
> | 
> | What is the best way for me to try this update?  Simply running 
> | mkoctfile on the new chol.cc generates very many errors.  Here are the 
> | last few:
> | 
> | /opt/local/include/octave-3.2.0/octave/utils.h:113: error: two or more 
> | data types in declaration of $,1rx?octave_sleep$,1ry?
> | /opt/local/include/octave-3.2.0/octave/utils.h:115: error: two or more 
> | data types in declaration of $,1rx?octave_usleep$,1ry?
> | /opt/local/include/octave-3.2.0/octave/utils.h:118: error: two or more 
> | data types in declaration of $,1rx?octave_raw_vsnprintf$,1ry?
> | chol.cc:48: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:48: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:48: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:341: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:341: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:341: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:491: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:491: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:491: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:583: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:583: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:583: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:800: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:800: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:800: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:984: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:984: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:984: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:1116: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:1116: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | chol.cc:1116: error: $,1rx?OCTAVE_EXPORT$,1ry? does not name a type
> | /opt/local/include/octave-3.2.0/octave/defun-int.h:47: error: storage 
> | size of $,1rx?install_dld_function$,1ry? isn$,1ry?t known
> | /opt/local/include/octave-3.2.0/octave/defun-int.h:42: error: storage 
> | size of $,1rx?install_builtin_function$,1ry? isn$,1ry?t known
> | 
> | I can run mkoctfile fine on some older octave c++ files I have lying around.
> 
> The .oct files that are part of Octave can't be built outside of the
> Octave build process unless you do some modification.  The #include
> directives assume that you are building inside the Octave source tree.
> 
> jwe
> 

That is what I suspected.  Is there an easy way to modify the include
statements?

Thanks,
Jonathan


More information about the Bug-octave mailing list