Changeset 545


Ignore:
Timestamp:
May 22, 2007 12:51:04 AM (12 years ago)
Author:
pbelotti
Message:

added Optimality-Based Bound Tightening (OBBT). Started coding of quadratic group expressions

Location:
branches/Couenne/Couenne
Files:
4 added
11 edited

Legend:

Unmodified
Added
Removed
  • branches/Couenne/Couenne/TODO

    r539 r545  
    11- Bilinear cuts
    22- trisection
    3 - extended formulation
    43- variable lhs/rhs of bounds containing expression defining aux vars
    54- OBBT
    6 
    7 
    85- cut currValue_ from expressions
    96- documentation
  • branches/Couenne/Couenne/src/Makefile.am

    r537 r545  
    4646        expression/operators/exprMinMax.cpp \
    4747        expression/operators/exprGroup.cpp \
     48        expression/operators/exprQuad.cpp \
    4849        expression/operators/impliedBounds-exprSum.cpp \
    4950        expression/operators/impliedBounds-exprDiv.cpp \
     
    8182        convex/boundTightening.cpp \
    8283        convex/genColCuts.cpp \
     84        convex/genRowCuts.cpp \
     85        convex/obbt.cpp \
    8386        problem/problem.cpp \
    8487        problem/problemIO.cpp \
     
    182185        expression/operators/exprSub.h \
    183186        expression/operators/exprGroup.h \
     187        expression/operators/exprQuad.h \
    184188        expression/exprConst.h \
    185189        expression/exprIVar.h \
  • branches/Couenne/Couenne/src/Makefile.in

    r537 r545  
    9898        expression/operators/exprMinMax.cpp \
    9999        expression/operators/exprGroup.cpp \
     100        expression/operators/exprQuad.cpp \
    100101        expression/operators/impliedBounds-exprSum.cpp \
    101102        expression/operators/impliedBounds-exprDiv.cpp \
     
    125126        convex/operators/trigNewton.cpp convex/CouenneCutGenerator.cpp \
    126127        convex/generateCuts.cpp convex/boundTightening.cpp \
    127         convex/genColCuts.cpp problem/problem.cpp \
    128         problem/problemIO.cpp problem/constraint.cpp \
    129         problem/tightenBounds.cpp problem/impliedBounds.cpp \
    130         problem/readASLfg.cpp util/drawCuts.cpp util/rootQ.c \
    131         readnl/readnl.cpp readnl/nl2e.cpp readnl/invmap.c
     128        convex/genColCuts.cpp convex/genRowCuts.cpp convex/obbt.cpp \
     129        problem/problem.cpp problem/problemIO.cpp \
     130        problem/constraint.cpp problem/tightenBounds.cpp \
     131        problem/impliedBounds.cpp problem/readASLfg.cpp \
     132        util/drawCuts.cpp util/rootQ.c readnl/readnl.cpp \
     133        readnl/nl2e.cpp readnl/invmap.c
    132134@COIN_HAS_ASL_TRUE@am__objects_1 = readnl.lo nl2e.lo invmap.lo
    133135am_libCouenne_la_OBJECTS = CouenneThreeWayBranchObj.lo \
     
    139141        exprLog.lo exprMul.lo exprOpp.lo exprPow.lo exprSin.lo \
    140142        exprCos.lo exprSub.lo exprSum.lo exprMinMax.lo exprGroup.lo \
    141         impliedBounds-exprSum.lo impliedBounds-exprDiv.lo \
     143        exprQuad.lo impliedBounds-exprSum.lo impliedBounds-exprDiv.lo \
    142144        impliedBounds-exprMul.lo exprOp.lo exprUnary.lo exprVar.lo \
    143145        exprAux.lo expression.lo simplifiers.lo simplify.lo \
     
    149151        conv-exprSinCos.lo conv-exprExp.lo conv-exprLog.lo \
    150152        conv-exprGroup.lo trigNewton.lo CouenneCutGenerator.lo \
    151         generateCuts.lo boundTightening.lo genColCuts.lo problem.lo \
    152         problemIO.lo constraint.lo tightenBounds.lo impliedBounds.lo \
    153         readASLfg.lo drawCuts.lo rootQ.lo $(am__objects_1)
     153        generateCuts.lo boundTightening.lo genColCuts.lo genRowCuts.lo \
     154        obbt.lo problem.lo problemIO.lo constraint.lo tightenBounds.lo \
     155        impliedBounds.lo readASLfg.lo drawCuts.lo rootQ.lo \
     156        $(am__objects_1)
    154157libCouenne_la_OBJECTS = $(am_libCouenne_la_OBJECTS)
    155158depcomp = $(SHELL) $(top_srcdir)/../depcomp
     
    380383        expression/operators/exprMinMax.cpp \
    381384        expression/operators/exprGroup.cpp \
     385        expression/operators/exprQuad.cpp \
    382386        expression/operators/impliedBounds-exprSum.cpp \
    383387        expression/operators/impliedBounds-exprDiv.cpp \
     
    407411        convex/operators/trigNewton.cpp convex/CouenneCutGenerator.cpp \
    408412        convex/generateCuts.cpp convex/boundTightening.cpp \
    409         convex/genColCuts.cpp problem/problem.cpp \
    410         problem/problemIO.cpp problem/constraint.cpp \
    411         problem/tightenBounds.cpp problem/impliedBounds.cpp \
    412         problem/readASLfg.cpp util/drawCuts.cpp util/rootQ.c \
    413         $(am__append_1)
     413        convex/genColCuts.cpp convex/genRowCuts.cpp convex/obbt.cpp \
     414        problem/problem.cpp problem/problemIO.cpp \
     415        problem/constraint.cpp problem/tightenBounds.cpp \
     416        problem/impliedBounds.cpp problem/readASLfg.cpp \
     417        util/drawCuts.cpp util/rootQ.c $(am__append_1)
    414418COINLIBS = \
    415419        $(OSIOBJDIR)/src/libOsi.la \
     
    488492        expression/operators/exprSub.h \
    489493        expression/operators/exprGroup.h \
     494        expression/operators/exprQuad.h \
    490495        expression/exprConst.h \
    491496        expression/exprIVar.h \
     
    627632@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exprOpp.Plo@am__quote@
    628633@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exprPow.Plo@am__quote@
     634@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exprQuad.Plo@am__quote@
    629635@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exprSin.Plo@am__quote@
    630636@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exprSub.Plo@am__quote@
     
    634640@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expression.Plo@am__quote@
    635641@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genColCuts.Plo@am__quote@
     642@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genRowCuts.Plo@am__quote@
    636643@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generateCuts.Plo@am__quote@
    637644@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getFixVarBinFun.Plo@am__quote@
     
    643650@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linearize.Plo@am__quote@
    644651@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nl2e.Plo@am__quote@
     652@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/obbt.Plo@am__quote@
    645653@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/powNewton.Plo@am__quote@
    646654@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/problem.Plo@am__quote@
     
    900908@am__fastdepCXX_FALSE@  $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o exprGroup.lo `test -f 'expression/operators/exprGroup.cpp' || echo '$(srcdir)/'`expression/operators/exprGroup.cpp
    901909
     910exprQuad.lo: expression/operators/exprQuad.cpp
     911@am__fastdepCXX_TRUE@   if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT exprQuad.lo -MD -MP -MF "$(DEPDIR)/exprQuad.Tpo" -c -o exprQuad.lo `test -f 'expression/operators/exprQuad.cpp' || echo '$(srcdir)/'`expression/operators/exprQuad.cpp; \
     912@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/exprQuad.Tpo" "$(DEPDIR)/exprQuad.Plo"; else rm -f "$(DEPDIR)/exprQuad.Tpo"; exit 1; fi
     913@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='expression/operators/exprQuad.cpp' object='exprQuad.lo' libtool=yes @AMDEPBACKSLASH@
     914@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     915@am__fastdepCXX_FALSE@  $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o exprQuad.lo `test -f 'expression/operators/exprQuad.cpp' || echo '$(srcdir)/'`expression/operators/exprQuad.cpp
     916
    902917impliedBounds-exprSum.lo: expression/operators/impliedBounds-exprSum.cpp
    903918@am__fastdepCXX_TRUE@   if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT impliedBounds-exprSum.lo -MD -MP -MF "$(DEPDIR)/impliedBounds-exprSum.Tpo" -c -o impliedBounds-exprSum.lo `test -f 'expression/operators/impliedBounds-exprSum.cpp' || echo '$(srcdir)/'`expression/operators/impliedBounds-exprSum.cpp; \
     
    11441159@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    11451160@am__fastdepCXX_FALSE@  $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o genColCuts.lo `test -f 'convex/genColCuts.cpp' || echo '$(srcdir)/'`convex/genColCuts.cpp
     1161
     1162genRowCuts.lo: convex/genRowCuts.cpp
     1163@am__fastdepCXX_TRUE@   if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT genRowCuts.lo -MD -MP -MF "$(DEPDIR)/genRowCuts.Tpo" -c -o genRowCuts.lo `test -f 'convex/genRowCuts.cpp' || echo '$(srcdir)/'`convex/genRowCuts.cpp; \
     1164@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/genRowCuts.Tpo" "$(DEPDIR)/genRowCuts.Plo"; else rm -f "$(DEPDIR)/genRowCuts.Tpo"; exit 1; fi
     1165@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='convex/genRowCuts.cpp' object='genRowCuts.lo' libtool=yes @AMDEPBACKSLASH@
     1166@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1167@am__fastdepCXX_FALSE@  $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o genRowCuts.lo `test -f 'convex/genRowCuts.cpp' || echo '$(srcdir)/'`convex/genRowCuts.cpp
     1168
     1169obbt.lo: convex/obbt.cpp
     1170@am__fastdepCXX_TRUE@   if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT obbt.lo -MD -MP -MF "$(DEPDIR)/obbt.Tpo" -c -o obbt.lo `test -f 'convex/obbt.cpp' || echo '$(srcdir)/'`convex/obbt.cpp; \
     1171@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/obbt.Tpo" "$(DEPDIR)/obbt.Plo"; else rm -f "$(DEPDIR)/obbt.Tpo"; exit 1; fi
     1172@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='convex/obbt.cpp' object='obbt.lo' libtool=yes @AMDEPBACKSLASH@
     1173@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1174@am__fastdepCXX_FALSE@  $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o obbt.lo `test -f 'convex/obbt.cpp' || echo '$(srcdir)/'`convex/obbt.cpp
    11461175
    11471176problem.lo: problem/problem.cpp
  • branches/Couenne/Couenne/src/convex/CouenneCutGenerator.h

    r534 r545  
    126126                 bool = false) const;  /// is it a global cut? No, by default
    127127
    128   /// add general linear envelope to convex function, given its
     128  /// Add general linear envelope to convex function, given its
    129129  /// variables' indices, the (univariate) function and its first
    130130  /// derivative
     
    136136                    bool = false) const;
    137137
    138   /// add half-plane through (x1,y1) and (x2,y2) -- resp. 4th, 5th,
     138  /// Add half-plane through (x1,y1) and (x2,y2) -- resp. 4th, 5th,
    139139  /// 6th, and 7th argument
    140140  int addSegment (OsiCuts &, int, int,
     
    158158  virtual bool doLocalSearch () const {return 0;}
    159159
    160   /// method to set the Bab pointer
     160  /// Method to set the Bab pointer
    161161  void setBabPtr (Bonmin::Bab *p)
    162162    {BabPtr_ = p;}
    163163
    164   /// get statistics
     164  /// Get statistics
    165165  void getStats (int &nrc, int &ntc, double &st) {
    166166    nrc = nrootcuts_;
     
    169169  }
    170170
    171   /// allow to get and set the infeasNode_ flag (used only in generateCuts())
     171  /// Allow to get and set the infeasNode_ flag (used only in generateCuts())
    172172  bool &infeasNode () const
    173173    {return infeasNode_;}
     174
     175  /// generate OsiRowCuts for current convexification
     176  void genRowCuts (const OsiSolverInterface &, OsiCuts &cs, int, int *) const;
    174177
    175178  /// generate OsiColCuts for improved (implied and propagated) bounds
     
    179182  bool boundTightening (const OsiSolverInterface &, OsiCuts &,
    180183                        char *, Bonmin::BabInfo * = NULL) const;
     184
     185  /// Optimality Based Bound Tightening
     186  int obbt (const OsiSolverInterface &, OsiCuts &, char *, Bonmin::BabInfo *) const;
    181187};
    182188
  • branches/Couenne/Couenne/src/convex/generateCuts.cpp

    r540 r545  
    1313#include "BonAuxInfos.hpp"
    1414
     15
    1516// fictitious bound for initial unbounded lp relaxations
    1617#define LARGE_BOUND 9.999e12
     18
     19
     20// translate changed bound sparse array into a dense one
     21void sparse2dense (int ncols, char *chg_bds, int *&changed, int &nchanged) {
     22
     23  // convert sparse chg_bds in something handier
     24  changed  = (int *) malloc (ncols * sizeof (int));
     25  nchanged = 0;
     26
     27  for (register int i=ncols, j=0; i--; j++)
     28    if (*chg_bds++) {
     29      *changed++ = j;
     30      nchanged++;
     31    }
     32
     33  changed = (int *) realloc (changed - nchanged, nchanged * sizeof (int));
     34}
     35
    1736
    1837/// a convexifier cut generator
     
    2140                                        OsiCuts &cs,
    2241                                        const CglTreeInfo info) const {
    23  
     42
     43  //  int nInitCuts = cs.sizeRowCuts ();
     44
    2445  /*printf (":::::::::::::::::::::::: level = %d, pass = %d, intree=%d\n Bounds:\n",
    2546    info.level, info.pass, info.inTree);*/
    2647
    27   //  for (int i=0; i < si. getNumCols(); i++)
    28   //      printf (" %3d [%.3e,%.3e]\n", i, si. getColLower () [i],
    29   //      si. getColUpper () [i]);
    30 
    3148  Bonmin::BabInfo * babInfo = dynamic_cast <Bonmin::BabInfo *> (si.getAuxiliaryInfo ());
    3249
     
    3451    babInfo -> setFeasibleNode ();
    3552
    36   double now = CoinCpuTime ();
    37 
    38   if (firstcall_) {
    39     printf ("Couenne:");
    40     fflush (stdout);
    41   }
    42 
    43   int ncols = problem_ -> nVars () + problem_ -> nAuxs ();
     53  double now   = CoinCpuTime ();
     54  int    ncols = problem_ -> nVars () + problem_ -> nAuxs ();
    4455
    4556  // This vector contains variables whose bounds have changed due to
     
    133144  }
    134145
    135   int *changed, nchanged;
     146  int *changed = NULL, nchanged;
    136147
    137148  //////////////////////// Bound tightening ///////////////////////////////////////////
    138149
    139   //  for (int i=0; i<problem_ -> nAuxs () + problem_ -> nVars (); i++ )
    140   //    printf ("%d: [%.4f %.4f]\n", i, problem_ -> Lb (i), problem_ -> Ub (i));
    141 
    142   if (! boundTightening (si, cs, chg_bds, babInfo)) {
    143 
    144     //    printf ("INFEASIBLE\n");
    145     //    for (int i=0; i<problem_ -> nAuxs () + problem_ -> nVars (); i++ )
    146     //      printf ("%d: [%.4f %.4f]\n", i, problem_ -> Lb (i), problem_ -> Ub (i));
    147 
     150  if ((info.pass == 0)  // do bound tightening only at first pass of cutting plane
     151      && (! boundTightening (si, cs, chg_bds, babInfo)))
    148152    goto end_genCuts;
    149   }
    150 
    151   //  for (int i=0; i<problem_ -> nAuxs () + problem_ -> nVars (); i++ )
    152   //    printf ("%d: [%.4f %.4f]\n", i, problem_ -> Lb (i), problem_ -> Ub (i));
    153153
    154154  //////////////////////// GENERATE CONVEXIFICATION CUTS //////////////////////////////
    155155
    156   // convert sparse chg_bds in something handier
    157   changed  = (int *) malloc (ncols * sizeof (int));
    158   nchanged = 0;
    159 
    160   for (register int i=ncols, j=0; i--; j++)
    161     if (*chg_bds++) {
    162       *changed++ = j;
    163       nchanged++;
    164     }
    165 
    166   delete [] (chg_bds -= ncols);
    167 
    168   changed = (int *) realloc (changed - nchanged, nchanged * sizeof (int));
    169 
    170   // For each auxiliary variable, create cut (or set of cuts) violated
    171   // by current point and add it to cs
    172 
    173   if (firstcall_)
    174     for (int i=0, j = problem_ -> nAuxs (); j--; i++) {
    175       if (problem_ -> Aux (i) -> Multiplicity () > 0)
    176         problem_ -> Aux (i) -> generateCuts (si, cs, this);
    177     }
    178   else { // chg_bds contains the indices of the variables whose bounds
    179          // have changes (a -1 follows the last element)
    180 
    181     for (int i=0, j = problem_ -> nAuxs (); j--; i++) {
    182 
    183       // TODO: check if list contains all and only aux's to cut
    184       /*expression * image = problem_ -> Aux (i) -> Image ();
    185       if (   (image -> Linearity () > LINEAR)          // if linear, no need to cut twice
    186           && (image -> dependsOn (changed, nchanged))  // if expression does not depend on
    187           )*/                                            // changed variables, do not cut
    188       if (problem_ -> Aux (i) -> Multiplicity () > 0)
    189         problem_ -> Aux (i) -> generateCuts (si, cs, this);
    190     }
    191   }
     156  sparse2dense (ncols, chg_bds, changed, nchanged);
     157
     158  //////////////////////
     159  genRowCuts (si, cs, nchanged, changed);
     160  //////////////////////
    192161
    193162  if (firstcall_) {
     
    208177  }
    209178
     179#define COU_OBBT_CUTOFF_LEVEL 3
     180
    210181  // change tightened bounds through OsiCuts
    211182  if (nchanged)
    212183    genColCuts (si, cs, nchanged, changed);
    213184
     185#ifdef USE_OBBT
     186  if ((info.pass == 0) &&
     187      !firstcall_ &&
     188      (CoinDrand48 () < (double) COU_OBBT_CUTOFF_LEVEL / (info.level + 1))) {
     189    // apply OBBT at all levels up to the COU_OBBT_CUTOFF_LEVEL-th,
     190    // and then with probability inversely proportional to the level
     191
     192#define THRES_NBD_CHANGED 1
     193
     194    int nImprov = obbt (si, cs, chg_bds, babInfo);
     195
     196    if (nImprov < 0)
     197      goto end_genCuts;
     198
     199    if (nImprov >= THRES_NBD_CHANGED) {
     200
     201      //      if (! (boundTightening (si, cs, chg_bds, babInfo)))
     202      //        goto end_genCuts;
     203
     204      /// OBBT has given good results, add convexification with
     205      /// improved bounds
     206
     207      sparse2dense (ncols, chg_bds, changed, nchanged);
     208
     209      genColCuts (si, cs, nchanged, changed);
     210      genRowCuts (si, cs, nchanged, changed);
     211    }
     212  }
     213#endif
     214
     215  delete [] chg_bds;
     216
    214217  // clean up
    215218  free (changed);
    216219
    217   if (firstcall_) {
    218     if (cs.sizeRowCuts ())
    219       printf (" %d initial cuts", cs.sizeRowCuts ());
    220     printf ("\n");
    221   }
     220  if ((firstcall_) && cs.sizeRowCuts ())
     221    printf ("Couenne: %d initial cuts\n", cs.sizeRowCuts ());
    222222
    223223 end_genCuts:
  • branches/Couenne/Couenne/src/expression/CouenneTypes.h

    r534 r545  
    2323                /*COU_EXPRIVAR, */
    2424                COU_EXPROP,     /***** n-ary operators *******************/
    25                 COU_EXPRSUB,  COU_EXPRSUM, COU_EXPRGROUP,
     25                COU_EXPRSUB,  COU_EXPRSUM, COU_EXPRGROUP, COU_EXPRQUAD,
    2626                COU_EXPRMIN,  COU_EXPRMUL, COU_EXPRPOW, COU_EXPRMAX, COU_EXPRDIV,
    2727                /*COU_EXPRBDIV,  COU_EXPRBMUL,*/
  • branches/Couenne/Couenne/src/expression/expression.h

    r543 r545  
    9494  static CouNumber Lbound   (int i) {return lbounds_   [i];}
    9595  static CouNumber Ubound   (int i) {return ubounds_   [i];}
    96   static CouNumber Variable (int i) {return variables_ [i];} // allow to set it
     96  static CouNumber Variable (int i) {return variables_ [i];}
     97
     98  /// return arrays
     99  static CouNumber *Lbounds   () {return lbounds_;}
     100  static CouNumber *Ubounds   () {return ubounds_;}
     101  static CouNumber *Variables () {return variables_;}
    97102
    98103  /// Constructor, destructor
  • branches/Couenne/Couenne/src/expression/operators/exprGroup.h

    r543 r545  
    9696inline CouNumber exprGroup::operator () () {
    9797
    98   register CouNumber  ret = c0_ + exprSum::operator () (),
    99                      *coe = coeff_;
     98  register CouNumber
     99     ret  = c0_ + exprSum::operator () (),
     100    *coe  = coeff_,
     101    *vars = expression::Variables ();
    100102
    101103  for (register int *ind = index_; *ind >= 0;)
    102     ret += *coe++ * expression::Variable (*ind++);
     104    ret += *coe++ * vars [*ind++];
    103105
    104106  return (currValue_ = ret);
  • branches/Couenne/Couenne/src/expression/operators/exprInv.cpp

    r544 r545  
    66 * (C) Pietro Belotti. This file is licensed under the Common Public License (CPL)
    77 */
    8 
    98
    109#include <exprInv.h>
  • branches/Couenne/Couenne/src/problem/CouenneProblem.h

    r543 r545  
    134134  /// h_i (x,y) <= u_i
    135135  ///
    136   void writeMod (char *filename, /// Name of the .mod file to be written
    137                  bool  aux);      /// true: with aux, false: without.
     136  void writeMod (const std::string &, /// Name of the .mod file to be written
     137                 bool);               /// true: with aux, false: without.
    138138
    139139  /// initialize auxiliary variables and their bounds from original
  • branches/Couenne/Couenne/src/problem/problemIO.cpp

    r543 r545  
    5252// store problem in a .mod file (AMPL)
    5353
    54 void CouenneProblem::writeMod (char *fname,  /// name of the mod file
    55                                bool aux) {   /// with or without auxiliaries?
     54void CouenneProblem::writeMod (const std::string &fname,  /// name of the mod file
     55                               bool aux) {                /// with or without auxiliaries?
    5656
    57   std::ofstream f (fname);
     57  std::ofstream f (fname.c_str ());
    5858
    5959  f << std::setprecision (10);
Note: See TracChangeset for help on using the changeset viewer.