Ignore:
Timestamp:
Nov 28, 2008 10:39:52 PM (11 years ago)
Author:
pbelotti
Message:

separating problem handling from AMPL reading

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/main/BonCouenne.cpp

    r37 r40  
    4040#define PRINTED_PRECISION 1e-5
    4141
     42#include "exprVar.hpp"
     43#include "exprConst.hpp"
     44#include "exprSum.hpp"
     45#include "exprClone.hpp"
     46#include "CouenneProblemElem.hpp"
     47#include "CouenneProblem.hpp"
     48
    4249int main (int argc, char *argv[])
    4350{
     
    5461    bb.setUsingCouenne (true);
    5562
     63    CouenneProblem *p = NULL;
     64
     65#if 1
     66    p = new CouenneProblem;
     67
     68    p -> addVariable (false, p -> domain ());
     69    p -> addVariable (false, p -> domain ());
     70    p -> addVariable (false, p -> domain ());
     71    p -> addVariable (false, p -> domain ());
     72
     73    p -> addObjective    (new exprSum (new exprClone (p->Var (1)), new exprClone (p->Var (2))), "min");
     74    p -> addLEConstraint (new exprSum (new exprClone (p->Var (0)), new exprClone (p->Var (2))),
     75                          new exprConst (1));
     76    p -> addEQConstraint (new exprSum (new exprClone (p->Var (1)), new exprClone (p->Var (2))),
     77                          new exprConst (1));
     78    p -> addEQConstraint (new exprSum (new exprClone (p->Var (1)), new exprClone (p->Var (3))),
     79                          new exprConst (1));
     80    p -> addEQConstraint (new exprSum (new exprClone (p->Var (2)), new exprClone (p->Var (3))),
     81                          new exprConst (1));
     82#endif
     83
    5684    CouenneSetup bonmin;
    57     if (!bonmin.InitializeCouenne (argv, NULL))
     85    if (!bonmin.InitializeCouenne (argv, p))
    5886      throw infeasible;
    5987
Note: See TracChangeset for help on using the changeset viewer.