URGENT pointer to the Objective

Matthew Wall mbwall_NO_SPAM at mit.edu
Sat Jun 13 12:51:17 EDT 1998


You must define Fool_Base::name_of_the_objective_function as a static
member function of the class Fool_Base.  a non-static member function will
not work because it is not the same type as a statically defined member
function.

See the C++ Lite FAQ at
http://www.cerfnet.com/~mpcline/C++-FAQs-Lite/pointers-to-members.html

matthew



>Hello,
>
>I need urgent help, because time is running ...
>
>I implemented a GA by copying and slightly modifying some of the
>examples dealing with Real-Number-GAs.
>
>The only difference I can see, is that my ga is not running as part of
>the function main(), but within class fool_base, or---even another
>try---within a separate class gene_obj.  Because of this (I guess) I
>get the following error-message while compiling with egcs-1.0.3a on
>Red-Hat- oder SuSE-Linux:
>foolbase.cc:1200: no matching function for call to
>`GA1DArrayAlleleGenome<float>::GA1DArrayAlleleGenome
>(GAAlleleSetArray<float> &, float (Fool_Base::*)(GAGenome &))'
>/usr/local/include/ga/GARealGenome.C:21: candidates are:
>GA1DArrayAlleleGenome<float>::GA1DArrayAlleleGenome(unsigned int, const
>GAAlleleSet<float> &, float (*)(GAGenome &), void *)
>/usr/local/include/ga/GARealGenome.C:35:
>GA1DArrayAlleleGenome<float>::GA1DArrayAlleleGenome(const
>GAAlleleSetArray<float> &, float (*)(GAGenome &), void *)
>/usr/local/include/ga/GA1DArrayGenome.h:154:
>GA1DArrayAlleleGenome<float>::GA1DArrayAlleleGenome(const
>GA1DArrayAlleleGenome<float> &)
>
>I would point this to the mismatch of (*), as offered from the galib
>and (Fool_Base::*), which is seen by the compiler.
>
>Please help me an tell me, how I can bind this objective into the
>genome.  It don't have much time left.
>
>Thank you very very! much
>
>	Jan
>
>--
>                                  Jan Braun
>    Beratung Rechenzentrum               E-Mail: Jan.Braun at tu-bs.de
>    Technische Universit"at              WWW: http://www.tu-bs.de/~c0031015/
>    38092 Braunschweig                   Tel: +49/531/391-5555
>    http://www.tu-bs.de/rz/beratung/     Fax: +49/531/391-5549
>
>===== ypchsh /usr/local/bin/emacs :-)  (-: ``Go FORTH now and create ...''====



Matthew Wall
mbwall_NO_SPAM at mit.edu
http://mit.edu/mbwall







More information about the galib mailing list