Changeset 1538


Ignore:
Timestamp:
Jan 14, 2010 5:11:49 PM (10 years ago)
Author:
pbonami
Message:

Only do FPump if problem has no general integers

Location:
trunk/Bonmin/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bonmin/src/Algorithms/BonBonminSetup.cpp

    r1537 r1538  
    511511    }
    512512    Index doHeuristicFPump = false;
    513     if(!options()->GetEnumValue("heuristic_feasibility_pump",doHeuristicFPump,prefix_.c_str())){
     513    if(!nonlinearSolver_->model()->hasGeneralInteger() && !options()->GetEnumValue("heuristic_feasibility_pump",doHeuristicFPump,prefix_.c_str())){
    514514      doHeuristicFPump = true;
    515515      std::string o_name = prefix_ + "heuristic_feasibility_pump";
  • trunk/Bonmin/src/Interfaces/BonTMINLP.cpp

    r851 r1538  
    1010#include "BonTMINLP.hpp"
    1111#include "IpBlas.hpp"
     12#include "BonTypes.hpp"
    1213
    1314namespace Bonmin{
     
    108109}
    109110
     111/** Say if has general integer variables.*/
     112bool
     113TMINLP::hasGeneralInteger(){
     114   int n, m, nnz_j, nnz_h;
     115   Ipopt::TNLP::IndexStyleEnum dummy;
     116   get_nlp_info(n, m, nnz_j, nnz_h, dummy);
     117   vector<double> x_lb(n);
     118   vector<double> x_ub(n);
     119   vector<double> g_lb(m);
     120   vector<double> g_ub(m);
     121   vector<VariableType> v_t(n);
     122   get_variables_types(n, v_t());
     123   get_bounds_info(n, x_lb(), x_ub(), m, g_lb(), g_ub());
     124   for(unsigned int i = 0 ; i < n ; i++){
     125      if(v_t[i] == INTEGER &&
     126         (x_lb[i] < - 0.99 || x_lb[i] > 0.99) &&
     127         (x_lb[i] <0.01 || x_ub[i] > 1.99) ){
     128         return false;
     129      }
     130   }
     131   return true;
     132}
    110133
    111134}
  • trunk/Bonmin/src/Interfaces/BonTMINLP.hpp

    r1438 r1538  
    395395  virtual bool hasLinearObjective(){return false;}
    396396
     397  /** Say if problem has general integer variables.*/
     398  bool hasGeneralInteger();
    397399  protected:
    398400    /** Copy constructor */
Note: See TracChangeset for help on using the changeset viewer.