Changeset 156


Ignore:
Timestamp:
Jun 16, 2009 4:24:38 PM (12 years ago)
Author:
pbelotti
Message:

returning real object, not reference

Location:
trunk/Couenne/src/expression
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/expression/exprAux.cpp

    r155 r156  
    273273/// return proper object to handle expression associated with this
    274274/// variable (NULL if this is not an auxiliary)
    275 CouenneObject &exprAux::properObject (CouenneProblem *p,
    276                                       Bonmin::BabSetupBase *base,
    277                                       JnlstPtr jnlst) {
     275CouenneObject exprAux::properObject (CouenneProblem *p,
     276                                     Bonmin::BabSetupBase *base,
     277                                     JnlstPtr jnlst) {
    278278
    279279  CouenneObject *retp = NULL;
     
    291291      (image_ -> ArgList () [1] -> Index () >= 0) &&
    292292      (fabs (lb ()) < COUENNE_EPS) &&
    293       (fabs (ub ()) < COUENNE_EPS))
     293      (fabs (ub ()) < COUENNE_EPS)) {
    294294
    295295    // it's a complementarity constraint object!
    296296
    297     return CouenneComplObject (p, this, base, jnlst);
    298   else return CouenneObject (p, this, base, jnlst);
     297    CouenneComplObject obj (p, this, base, jnlst);
     298    return obj;
     299  }
     300  else {
     301    CouenneObject obj (p, this, base, jnlst);
     302    return obj;
     303  }
    299304
    300305  //  return (*retp);
  • trunk/Couenne/src/expression/exprAux.hpp

    r155 r156  
    184184  /// return proper object to handle expression associated with this
    185185  /// variable (NULL if this is not an auxiliary)
    186   CouenneObject &properObject (CouenneProblem *p,
    187                                Bonmin::BabSetupBase *base,
    188                                JnlstPtr jnlst);
     186  CouenneObject properObject (CouenneProblem *p,
     187                              Bonmin::BabSetupBase *base,
     188                              JnlstPtr jnlst);
    189189};
    190190
  • trunk/Couenne/src/expression/exprVar.cpp

    r155 r156  
    6969// dummy function -- the real one is in exprAux and returns either a
    7070// CouenneObject or a CouenneComplObject
    71 CouenneObject &exprVar::properObject (CouenneProblem *p,
     71CouenneObject exprVar::properObject (CouenneProblem *p,
    7272                                      Bonmin::BabSetupBase *base,
    7373                                      JnlstPtr jnlst_) {
    74   return (*(new CouenneObject ()));
     74  return CouenneObject ();
    7575}
  • trunk/Couenne/src/expression/exprVar.hpp

    r155 r156  
    192192  /// return proper object to handle expression associated with this
    193193  /// variable (NULL if this is not an auxiliary)
    194   virtual CouenneObject &properObject (CouenneProblem *p,
    195                                        Bonmin::BabSetupBase *base,
    196                                        JnlstPtr jnlst_);
     194  virtual CouenneObject properObject (CouenneProblem *p,
     195                                      Bonmin::BabSetupBase *base,
     196                                      JnlstPtr jnlst_);
    197197};
    198198
Note: See TracChangeset for help on using the changeset viewer.