Expand|Select|Wrap|Line Numbers
- using namespace Ipopt;
- class base : public TNLP
- {
- base();
- virtual ~base();
- public:
- //I want fisrt to apply the routine to my problem, and I have to creat many member functions in the derived class. for this I creat
- //a simple virtual function
- //all methods that are implement by Ipopt team are unchanged, and I modify the end of the code by making:
- Protected:
- virtual void sae(double aa_01, double ab_01, double ac_02, double ad_02);
- };
- class derived_class: public base
- {
- public:
- derived_class()
- {}
- virtual ~derived_class()
- {}
- virtual void sae(double aa_01, double ab_01, double ac_02, double ad_02)
- // then I define aa_01, ab_01, ac_02, ad_02
- {
- aa_01=22;
- ab_01=222;
- ac_02=0;
- ad_02=10;
- }
Expand|Select|Wrap|Line Numbers
- base ::base ()
- {}
- base :~base()
- {}
- void base::sae(double aa_01, double ab_01, double ac_02, double ad_02)
- {
- base *ptr = new derived_class();
- ptr->sae(aa_01, ab_01, ac_02, ad_02);
- // and when attribute ptr to aa_01
- aa_01_ = ptr->aa_01;
- ab_01_ = ab_01;
- ac_02_ = ac_02;
- ad_02_ = ad_02;
- }
the compiler shows derived class has no member named ‘aa_01’; did you mean ‘aa_01_’?
please help how can I resolve this? and how can I call, in cpp file, the derived class first and specified member in that class which contains the core of my problem
Thank you,