help-octave
[Top][All Lists]
Advanced

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

Problem compiling fsolve.cc from octave-forge/FIXES


From: Michael Kopp
Subject: Problem compiling fsolve.cc from octave-forge/FIXES
Date: Tue, 10 May 2005 11:50:15 +0200
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)

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: address@hidden



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

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