Changeset 509


Ignore:
Timestamp:
Apr 26, 2007 9:37:06 AM (12 years ago)
Author:
pbonami
Message:

Free ASL object

Location:
trunk/Bonmin/experimental/NotConvex
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bonmin/experimental/NotConvex/BonCouenneSetup.cpp

    r508 r509  
    99
    1010#include "BonCouenneSetup.hpp"
    11 #include "BonBonminSetup.hpp"
    1211#include "BonNlpHeuristic.hpp"
    1312#include "BonCouenneInterface.hpp"
     
    1716#include "BonAuxInfos.hpp"
    1817
     18
     19#include "asl.h"
     20#include "getstub.h"
     21
    1922namespace Bonmin{
     23 
     24  CouenneSetup::~CouenneSetup(){
     25    if(aslfg_ != NULL)
     26      ASL_free(&aslfg_);
     27  }
     28 
     29 
    2030  void CouenneSetup::InitializeBonmin(char **& argv){
    2131    /* Get the basic options. */
     
    3343    /* Read the model in various places. */
    3444    ci->readAmplNlFile(argv,roptions(),options(),journalist());
    35     ASL * aslfg = readASLfg (argv);
     45    aslfg_ = readASLfg (argv);
    3646   
    3747   
    3848    /* Initialize Couenne cut generator.*/
    39     CouenneCutGenerator * couenneCg = new CouenneCutGenerator(ci, aslfg, true, CURRENT_ONLY,1);
     49    CouenneCutGenerator * couenneCg = new CouenneCutGenerator(ci, aslfg_, true, CURRENT_ONLY,1);
    4050    CouenneProblem * couenneProb = couenneCg -> Problem();
    4151
     
    131141void
    132142  CouenneSetup::registerAllOptions(Ipopt::SmartPtr<Ipopt::RegisteredOptions> roptions){
    133     BonminSetup::registerAllOptions(roptions);
     143    BabSetupBase::registerAllOptions(roptions);
    134144    roptions->SetRegisteringCategory("Couenne options");
    135145   
  • trunk/Bonmin/experimental/NotConvex/BonCouenneSetup.hpp

    r508 r509  
    1111#include "BonBabSetupBase.hpp"
    1212
     13struct ASL;
     14
    1315namespace Bonmin{
    1416  class CouenneSetup : public BabSetupBase{
     
    1618    /** Default constructor*/
    1719    CouenneSetup():
    18     BabSetupBase(){}
     20    BabSetupBase(),
     21    aslfg_(NULL){}
    1922   
    2023    /** Copy constructor.*/
    2124    CouenneSetup(const CouenneSetup& other):
    22       BabSetupBase(other){}
     25      BabSetupBase(other),
     26      aslfg_(NULL){}
    2327   
    2428    /** virtual copy constructor.*/
     
    2630      return new CouenneSetup(*this);
    2731    }
    28 
     32   
     33    virtual ~CouenneSetup();
    2934    /** Initialize from command line arguments.*/
    3035    void InitializeBonmin(char **& argv);
     
    3843      if(readOptions_) return;
    3944      BabSetupBase::readOptionsFile("couenne.opt");}
     45private:
     46      ASL * aslfg_;
    4047  };
    4148 
Note: See TracChangeset for help on using the changeset viewer.