From: Paul K. <pki...@us...> - 2005-05-31 00:25:14
|
I have no interest in maintaining this function. I am removing it from the build system for now, and will purge it completely if nobody steps forward to update it. IIRC, the purpose of this function is to pass extra arguments to fsolve, but we can do this now with the new syntax: @(x) f(x,a,b,c) - Paul On May 10, 2005, at 5:50 AM, Michael Kopp wrote: > Hi all, > > I was just trying to compile fsolve.cc from octave_forge/FIXES > (a link to the file can be found here: > http://octave.sourceforge.net/index/optimization.html#Rootfinding). > > I used the command "mkoctfile fsolve.cc" on a PC with Suse Linux 9.1. > My version of gcc is 3.3.3. > > I got the following error message: > > ********************************************************************** > fsolve.cc:260: error: cannot convert `double (NLEqn_options::*)() > const' to `double (NLEqn_options::*)()' in initialization > ********************************************************************** > > The relevant code from fsolve.cc seems to be > > ********************************************************************** > struct NLEQN_OPTIONS > { > const char *keyword; > const char *kw_tok[MAX_TOKENS + 1]; > int min_len[MAX_TOKENS + 1]; > int min_toks_to_match; > d_set_opt_mf d_set_fcn; > d_get_opt_mf d_get_fcn; > }; > > static NLEQN_OPTIONS fsolve_option_table [] = > { > { "tolerance", > { "tolerance", 0, }, > { 1, 0, }, 1, > &NLEqn_options::set_tolerance, > &NLEqn_options::tolerance, }, // here is the problem > > { 0, > { 0, 0, }, > { 0, 0, }, 0, > 0, 0, }, > }; > ********************************************************************** > > The problem is in the line &NLEqn_options::tolerance. If I outcomment > this, the rest compiles fine. From > http://pareto.uab.es/mcreel/OctaveClassReference/html/index.html > I get the following information: > > ********************************************************************** > NLEqn_options Class Reference > Public Member Functions > NLEqn_options (void) > NLEqn_options (const NLEqn_options &opt) > NLEqn_options & operator= (const NLEqn_options &opt) > ~NLEqn_options (void) > void init (void) > void copy (const NLEqn_options &opt) > void set_options (const NLEqn_options &opt) > void set_default_options (void) > void set_tolerance (double val) > double tolerance (void) const > ********************************************************************** > > So the tolerance function is indeed declared with const. > Unfortunately, my rudimentary knowledge of C++ does not allow me to > find a workaround other than outcommenting the entire line. Does > anyone have a better solution? > > Thanks in advance, > > Michael. > > > > > -- > Michael Kopp > Department Biologie II > University of Munich (LMU) > Grosshaderner Strasse 2 > 82152 Plannegg-Martinsried > Germany > > Phone: ++49-89-2180-74233 > Email: ko...@zi... > > > > ------------------------------------------------------------- > Octave is freely available under the terms of the GNU GPL. > > Octave's home on the web: http://www.octave.org > How to fund new projects: http://www.octave.org/funding.html > Subscription information: http://www.octave.org/archive.html > ------------------------------------------------------------- > |