Changeset 91


Ignore:
Timestamp:
Apr 2, 2009 1:07:38 AM (11 years ago)
Author:
pbelotti
Message:

fixed serious bug. Failed to find optimum due to duplicate variable...

Location:
trunk/Couenne/src/standardize
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/standardize/linStandardize.cpp

    r75 r91  
    126126#endif
    127127
     128  //if (ret -> Type () == AUX)
     129  //return ret;
     130
    128131  return (addAux ? addAuxiliary (ret) : new exprAux (ret, &domain_));
    129132}
  • trunk/Couenne/src/standardize/splitAux.cpp

    r1 r91  
    353353          //*mullist = new exprSum (newarglist, nargs);
    354354          *mullist = (*newarglist) -> Argument ();//, nargs);
    355         else  // multiple nonlinear terms, multiply them by -1/auxcoe
    356           *mullist = new exprMul (new exprConst (-1. / auxcoe),
    357                                   new exprSum (newarglist, nargs));
     355        else { // multiple nonlinear terms, multiply them by -1/auxcoe
     356
     357          if (nargs <= 1)
     358            *mullist = new exprMul (new exprConst (-1. / auxcoe),
     359                                    *newarglist); // !!! one more leak?
     360          else
     361            *mullist = new exprMul (new exprConst (-1. / auxcoe),
     362                                    new exprSum (newarglist, nargs));
     363        }
    358364
    359365        std::vector <std::pair <exprVar *, CouNumber> > lcoeff;
  • trunk/Couenne/src/standardize/sumStandardize.cpp

    r1 r91  
    7979
    8080#ifdef DEBUG
    81   printf ("decompTerm returns: [");
     81  printf ("decompTerm: lin [");
    8282  for (std::map <int, CouNumber>::iterator i = lmap.Map().begin (); i != lmap.Map().end (); ++i)
    8383    printf ("<%d,%g>", i -> first, i -> second);
    84   printf ("] -- [");
     84  printf ("] -- quad [");
    8585  for (std::map <std::pair <int, int>, CouNumber>::iterator i = qmap.Map ().begin ();
    8686       i != qmap.Map ().end (); ++i)
Note: See TracChangeset for help on using the changeset viewer.