Changeset 1094 for trunk


Ignore:
Timestamp:
Jan 10, 2015 11:59:20 AM (5 years ago)
Author:
pbelotti
Message:

check duplicate indices (should be done earlier...). introduce operator< with two parameters for mac/Xcode. extra check in standardization

Location:
trunk/Couenne/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/convex/createCuts.cpp

    r748 r1094  
    4343  int nterms = 0;
    4444
     45  // first check: duplicate index.
     46
     47  if ((i1 != -1) && (i1 == i3)) {i3 = -1; c1 += c3; c3 = 0;}
     48  if ((i2 != -1) && (i2 == i3)) {i3 = -1; c2 += c3; c3 = 0;}
     49  if ((i1 != -1) && (i1 == i2)) {i2 = -1; c1 += c2; c2 = 0;}
     50
    4551  // CAUTION: this can make the problem infeasible...
    4652  if (fabs (c3) <= 1.e-21) {                                    i3 = -1;} // shift coeff/index to
  • trunk/Couenne/src/cut/sdpcuts/CouenneMatrix.hpp

    r956 r1094  
    4848    }
    4949
    50     CouenneScalar *clone () {return new CouenneScalar (*this);}
     50    inline CouenneScalar *clone () {return new CouenneScalar (*this);}
    5151
    5252    inline int         getIndex () const {return index_;}
    5353    inline expression *getElem  () const {return elem_;}
    5454
    55     bool operator< (const CouenneScalar &rhs) const {return (index_ < rhs.index_);}
     55    inline bool operator< (const CouenneScalar &rhs) const {return (index_ < rhs.index_);}
     56
     57    friend bool operator< (const CouenneScalar &first, const CouenneScalar &second);
    5658
    5759    void print () const;
    5860  };
    5961
     62  inline bool operator< (const CouenneScalar &first, const CouenneScalar &second) {return (first.index_ < second.index_);}
    6063
    6164  // Sparse vector of expressions /////////////////////////////////////////////////
  • trunk/Couenne/src/heuristics/CouenneFeasPumpConstructors.cpp

    r1077 r1094  
    241241  const double *iS = iSol;
    242242
     243  // TODO:
     244  //
     245  // 1) resize list
     246  // 2) separate H norm from distance
     247  // 3
     248
    243249  if ((multHessNLP_ == 0.) ||
    244250      (nlp_ -> optHessian () == NULL)) {
  • trunk/Couenne/src/standardize/standardize.cpp

    r1080 r1094  
    475475        }
    476476
    477         if (simpl) {
     477        if (simpl && simpl != subst) {
    478478
    479479          has_changed = true;
Note: See TracChangeset for help on using the changeset viewer.