I had been advised elsewhere to look at memfun and bind1 (but not mem_fun or better even boost::mem_fn or boost::bind). And finding examples was not that simple, but the final solution is:

brent_find_minima(boost::bind(&Testclass::TrickyF, this, _1), min, max, bits);

with 'Testclass' my class in which a function named 'TrickyF' is defined, and min, max, bits further arguments for brent_find_minima.

On Mon, Jul 13, 2009 at 6:13 PM, s seelenluft <sseelenluft@gmail.com> wrote:
Hi,

I found this example: http://net.pku.edu.cn/~webg/src/paradise/thirdparty/installed/include/boost-1_35/boost/math/tools/minima.hpp which works fine but I have trouble figuring out how to adapt this if the function to minimize is a member function of a class (and invoked in another member function).
Any example of how to call brent_find_minima (or similar functions) from a member function and minimizing a member function would be very welcome. I have to the advice to wrap the function to be minimized into a static wrapper function but could not find an example how to do this from within a member function (I have it working when calling from main).

Thanks.

Markus