[Coin-discuss] little problem solved in ClpPackedMatrix.cpp

John J Forrest jjforre at us.ibm.com
Tue Jun 29 05:31:01 EDT 2004




Rolf,

I don't really understand.  As far as I know dynamic cast is the virtuous
way to do this.  I only added the NO_RTTI as someone was claiming that it
was faster if they switched off dynamic casting.  I could not verify the
speed claim but added the NO_RTTI code.

Some tuning has been done - mainly on Linux.  My Intel tuning tools for
Windows were good but are now out of date.  So tuning has been done to a
reasonable extent at a macro level but not for Intel tuning.  The code is
tuned for large problems, not really for small ones so there may be more
scope there.

John Forrest


                                                                           
             Rolf Steenge                                                  
             <rolf_steenge at pla                                             
             net.nl>                                                    To 
             Sent by:                                                      
             coin-discuss-admi         coin-discuss at www-124.southbury.usf. 
             n at www-124.southbu         ibm.com                             
             ry.usf.ibm.com                                             cc 
                                                                           
                                                                           
             06/28/2004 01:44                                              
             PM                                                            
                                                                           
                                                                   Subject 
             Please respond to         [Coin-discuss] little problem       
               coin-discuss            solved in ClpPackedMatrix.cpp       
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Dear Coin,

I found a small problem in the program ClpPackedMatrix.cpp in the function
ClpPackedMatrix::scale:

Original code:

#ifndef NO_RTTI
    ClpQuadraticObjective * quadraticObj = (dynamic_cast<
ClpQuadraticObjective*>(obj));
#else
    ClpQuadraticObjective * quadraticObj = NULL;
    if (obj->type()==2)
      quadraticObj = (static_cast< ClpQuadraticObjective*>(obj));
#endif
I have NO_RTTI in my project settings (MS visual C++ V6, Windows/XP) and
ran into the debugger, because obj->type() was 1 and not 2. So I changed
the code in line with the RTTI case and had no more problems:

ClpQuadraticObjective * quadraticObj = NULL;
#ifndef NO_RTTI
 if (obj->type()==2)
  quadraticObj = (ClpQuadraticObjective*)obj;
#else
    if (obj->type()==2)
      quadraticObj = (static_cast< ClpQuadraticObjective*>(obj));
#endif

Another question: would it be helpful to run the profiler to see what the
most cpu demanding functions are and then try to adapt these functions in
order to improve overall performance. Or is this something that already has
been done?

Regards
Rolf Steenge
Archipel 3619
8224 HL Lelystad
the Netherlands
Europe
mail rolf_steenge at planet.nl






More information about the Coin-discuss mailing list