Changeset 1414


Ignore:
Timestamp:
Apr 10, 2009 7:23:13 AM (11 years ago)
Author:
pbonami
Message:

More fixes for unconstrained problems with windows

Location:
trunk/Bonmin/src/Interfaces
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bonmin/src/Interfaces/BonOsiTMINLPInterface.cpp

    r1408 r1414  
    10081008  assert(rowsense_==NULL&&rhs_==NULL&&rowrange_==NULL);
    10091009  int numrows = problem_->num_constraints();
     1010  if(numrows == 0) return;
    10101011  const double * rowLower = getRowLower();
    10111012  const double * rowUpper = getRowUpper();
  • trunk/Bonmin/src/Interfaces/BonTMINLP2TNLP.cpp

    r1412 r1414  
    316316      duals_init_ = x_init_() + num_variables();
    317317
    318     IpBlasDcopy(m, duals_init, 1, duals_init_, 1);
     318    if(m >0)
     319      IpBlasDcopy(m, duals_init, 1, duals_init_, 1);
    319320
    320321  }
     
    356357    IpBlasDcopy(n, x_l_(), 1, x_l, 1);
    357358    IpBlasDcopy(n, x_u_(), 1, x_u, 1);
    358     IpBlasDcopy(m, g_l_(), 1, g_l, 1);
    359     IpBlasDcopy(m, g_u_(), 1, g_u, 1);
     359    if (m > 0){
     360      IpBlasDcopy(m, g_l_(), 1, g_l, 1);
     361      IpBlasDcopy(m, g_u_(), 1, g_u, 1);
     362    }
    360363    return true;
    361364  }
     
    385388      if(duals_init_ == NULL)
    386389        return false;
    387       IpBlasDcopy(m, duals_init_ + 2*n , 1, lambda, 1);
     390      if(m > 0)
     391        IpBlasDcopy(m, duals_init_ + 2*n , 1, lambda, 1);
    388392    }
    389393
  • trunk/Bonmin/src/Interfaces/BonTypes.hpp

    r1372 r1414  
    2929
    3030/** Access pointer to first element of storage.*/
    31 inline T* operator()(){return &std::vector<T>::front();}
     31inline T* operator()(){
     32#if defined(_MSC_VER)
     33  if (size() == 0)
     34    return NULL;
     35#endif
     36return &std::vector<T>::front();}
    3237/** Access pointer to first element of storage.*/
    33 inline const T* operator()() const {return &std::vector<T>::front();}
     38inline const T* operator()() const {
     39#if defined(_MSC_VER)
     40  if (size() == 0)
     41    return NULL;
     42#endif
     43return &std::vector<T>::front();
     44}
    3445};
    3546
Note: See TracChangeset for help on using the changeset viewer.