/home/coin/SVN-release/OS-2.4.1/Couenne/src/main/SmartAslDestr.cpp

Go to the documentation of this file.
00001 // $Id: SmartAslDestr.cpp 488 2011-01-10 17:06:41Z pbelotti $
00002 //
00003 // (C) Copyright International Business Machines Corporation 2007
00004 // All Rights Reserved.
00005 // This code is published under the Eclipse Public License (EPL).
00006 //
00007 // Authors :
00008 // Pierre Bonami, International Business Machines Corporation
00009 // Pietro Belotti, Lehigh University
00010 //
00011 // Date : 05/31/2010
00012 
00013 // Ampl includes
00014 
00015 #include "BonCouenneSetup.hpp"
00016 
00017 #ifdef COIN_HAS_ASL
00018 #include "asl.h"
00019 #include "getstub.h"
00020 #endif
00021 
00022 using namespace Couenne;
00023   
00024 SmartAsl::~SmartAsl(){
00025 #ifdef COIN_HAS_ASL
00026   //Code from Ipopt::AmplTNLP to free asl
00027   if(asl != NULL){
00028     if (X0) {
00029       delete [] X0;
00030       X0 = NULL;
00031     }
00032     if (havex0) {
00033       delete [] havex0;
00034       havex0 = NULL;
00035     }
00036     if (pi0) {
00037       delete [] pi0;
00038       pi0 = NULL;
00039     }
00040     if (havepi0) {
00041       delete [] havepi0;
00042       havepi0 = NULL;
00043     }
00044     ASL* asl_to_free = (ASL*)asl;
00045     ASL_free(&asl_to_free);
00046     asl = NULL;
00047   }
00048   ASL_free(&asl);
00049 #endif
00050 }
00051   

Generated on Thu Nov 10 03:05:45 2011 by  doxygen 1.4.7