forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 11:21 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Error when using a member function in alglib::minlbfgsoptimi
PostPosted: Tue Nov 15, 2011 3:57 am 
Offline

Joined: Sat Jun 05, 2010 6:30 am
Posts: 5
I have a class algo, which has a function algo::function1

when I run this
Code:
alglib::minlbfgsoptimize(state, &algo::function1);


It gives me the error

Code:
error C2664: 'alglib::minlbfgsoptimize' : cannot convert parameter 2 from 'void (__thiscall algo::* )(const alglib::real_1d_array &,double &,alglib::real_1d_array &,void *)' to 'void (__cdecl *)(const alglib::real_1d_array &,double &,alglib::real_1d_array &,void *)'


May I know what went wrong?Thank you!


Top
 Profile  
 
 Post subject: Re: Error when using a member function in alglib::minlbfgsop
PostPosted: Tue Nov 15, 2011 11:20 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
That's because ALGLIB needs non-member function pointer, and you pass pointer to the member function. You have to write non-member proxy() function which calls member function of your choice, and pass this proxy function to the ALGLIB.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 38 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group