[Coin-discuss] accessing the Clp solver from Cbc/Clp

John J Forrest jjforre at us.ibm.com
Wed Jun 28 04:00:56 EDT 2006


You need to use dynamic_cast to get an OsiClpSolverInterface pointer from
an OsiSolverInterface pointer.  See an example at line 155 of repeat.cpp.
It will be a valid pointer if it was an OsiClpSolverInterface pointer NULL
otherwise.

So you can also use it to see what solver you have.  You can also use
getStrParam(OsiSolverName,std::string&)

John Forrest


                                                                           
             Kish Shen                                                     
             <kish.shen at crossc                                             
             oreop.com>                                                 To 
             Sent by:                  coin-discuss at list.coin-or.org       
             coin-discuss-boun                                          cc 
             ces at list.coin-or.                                             
             org                                                   Subject 
                                       Re: [Coin-discuss] accessing the    
                                       Clp solver from Cbc/Clp             
             06/28/06 12:48 AM                                             
                                                                           
                                                                           
             Please respond to                                             
             Discussions about                                             
                open source                                                
               software for                                                
                Operations                                                 
                 Research                                                  
             <coin-discuss at lis                                             
              t.coin-or.org>                                               
                                                                           
                                                                           




On Wednesday 28 June 2006 05:35, J P Fasano wrote:
> > The situation I am thinking of is when I am using Clp within Cbc, i.e.
>
> using
>
> > OsiCbcSolverInterface.  In this case, getModelPtr() returns the pointer
>
> to
>
> > the  CbcModel, not the ClpModel.
>
> Ok.  How about using:
>       OsiSolverInterface * OsiCbcSolverInterface::getRealSolverPtr ()
const
> see:
>
http://www.coin-or.org/Doxygen/Osi/class_osi_cbc_solver_interface.html#z178
>_1

This returns an OsiSolverInterface *, which doesn't have a getModelPtr(),
or
is there someway of getting from this to OsiClpSolverInterface? [this may
reflect my lack of knowledge on C++, rather than anything else]

Cheers,

Kish
_______________________________________________
Coin-discuss mailing list
Coin-discuss at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/coin-discuss





More information about the Coin-discuss mailing list