Changeset 77


Ignore:
Timestamp:
Mar 13, 2009 6:39:24 AM (11 years ago)
Author:
stefan
Message:

merge changeset 70 from trunk into stable: compile Couenne library without ASL

Location:
stable/0.1/Couenne
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • stable/0.1/Couenne

  • stable/0.1/Couenne/src/main/BonCouenneInterface.cpp

    r1 r77  
    3737}
    3838
    39 
     39#ifdef COIN_HAS_ASL   
    4040void
    4141CouenneInterface::readAmplNlFile(char **& argv, Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions,
     
    4444  AmplInterface::readAmplNlFile(argv, roptions, options, journalist);
    4545}
     46#endif
    4647
    4748/** \name Overloaded methods to build outer approximations */
  • stable/0.1/Couenne/src/main/BonCouenneInterface.hpp

    r1 r77  
    1111#ifndef CouenneInterface_H
    1212#define CouenneInterface_H
    13 #include "BonAmplInterface.hpp"
     13
    1414#include "CouenneCutGenerator.hpp"
    1515
     16#ifdef COIN_HAS_ASL
     17#include "BonAmplInterface.hpp"
    1618
    1719struct ASL;
    18 
    1920struct ASL *readASLfg (char **);
    20 
     21#else
     22#define AmplInterface OsiTMINLPInterface
     23#endif
    2124
    2225namespace Bonmin {
     
    3639  virtual ~CouenneInterface();
    3740
    38    
     41#ifdef COIN_HAS_ASL   
    3942  /** read ampl file using inputed options, journalist....*/
    4043  virtual void readAmplNlFile(char **& argv, Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions,
    4144                              Ipopt::SmartPtr<Ipopt::OptionsList> options,
    4245                              Ipopt::SmartPtr<Ipopt::Journalist> journalist);
    43  
     46#endif
    4447  /** \name Overloaded methods to build outer approximations */
    4548  //@{
  • stable/0.1/Couenne/src/main/BonCouenneSetup.cpp

    r45 r77  
    4040
    4141// Ampl includes
     42#ifdef COIN_HAS_ASL
    4243#include "asl.h"
    4344#include "getstub.h"
    44 
     45#endif
    4546
    4647namespace Bonmin{
    4748 
    4849  SmartAsl::~SmartAsl(){
     50#ifdef COIN_HAS_ASL
    4951    //Code from Ipopt::AmplTNLP to free asl
    5052    if(asl != NULL){
     
    7072    }
    7173    ASL_free(&asl);
     74#endif
    7275  }
    7376 
     
    9194    CouenneInterface * ci = new CouenneInterface;
    9295    nonlinearSolver_ = ci;
     96#ifdef COIN_HAS_ASL
    9397    /* Read the model in various places. */
    9498    ci->readAmplNlFile(argv,roptions(),options(),journalist());
    9599    aslfg_ = new SmartAsl;
    96100    aslfg_->asl = readASLfg (argv);
    97 
     101#else
     102    std::cerr << "Couenne was compiled without AMPL Solver Library. Cannot initialize from AMPL NL File." << std::endl;
     103    return false;
     104#endif
    98105    /** Set the output level for the journalist for all Couenne
    99106     categories.  We probably want to make that a bit more flexible
  • stable/0.1/Couenne/src/problem/CouenneProblem.cpp

    r1 r77  
    6363  double now = CoinCpuTime ();
    6464
     65#ifdef COIN_HAS_ASL
    6566  // read problem from AMPL structure
    6667  readnl (asl);
     68#else
     69  jnlst_ -> Printf (Ipopt::J_ERROR, J_PROBLEM, "Couenne was compiled without ASL library. Cannot process ASL structure.\n");
     70  throw -1;
     71#endif
    6772
    6873  if ((now = (CoinCpuTime () - now)) > 10.)
  • stable/0.1/Couenne/src/problem/CouenneProblem.hpp

    r28 r77  
    268268  void print (std::ostream & = std::cout);
    269269
     270#ifdef COIN_HAS_ASL
    270271  /// Read problem from .nl file using the Ampl Solver Library (ASL)
    271272  int readnl (const struct ASL *);
     
    273274  /// Generate a Couenne expression from an ASL expression
    274275  expression *nl2e (struct expr *, const ASL *asl);
     276#endif
    275277
    276278  // bound tightening parameters
Note: See TracChangeset for help on using the changeset viewer.