Changeset 237


Ignore:
Timestamp:
Jan 31, 2006 11:35:19 AM (14 years ago)
Author:
forrest
Message:

for ampl

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/README

    r2 r237  
    44will probably need Clp as well.
    55
    6 To make the unitTest and standalone executable do
     6If you are using Clp as your solver then you can make the unitTest and standalone executable by doing
     7
     8make solve in this directory.  This creates an executable solve.
     9
     10solve takes various options - try solve and then ? to get some idea of what you can do.
     11solve file will do branch and bound if file is integer mps file and will do dual if non-integer mps file
     12options start with - (although the code will also try without -) e.g.
     13
     14solve file -cuts root -solve will import file and do branch and bound with cuts only at root
     15
     16- by itself goes to interactive mode.
     17
     18If you wish to use the Cbc solver from AMPL there is a bit of work involved.  You
     19will need to uncomment COIN_ampl in Makefiles/makefile.location - and also
     20download the ampl glue code - see Makefiles/Makefile.location for http.  Then solve
     21will assume it is being called from AMPL if the first two arguments are xxx.nl -AMPL.
     22Of course "solve" is not a good name (cbc is much better but already used) so copy
     23"solve" to "cbc" in ampl accessible path.
     24Options may be set by e.g. option cbc_options "cuts=off log=0"
     25No keywords are recognized by ampl parsing so above format should be used.
     26All options are as found by "cbc(solve) " and then ?
     27Current ugliness is that ampl glue code assumes "=" (on undefined keywords) so to maximize you
     28would have to say "maximize=".  I will add to AMPL keywords if this interface gets much use.
     29
     30If you are not using Clp then fewer options are available -
     31make the unitTest and standalone executable by doing
    732
    833make unitTest in this directory.  This creates an executable cbc.
     
    1641On Linux cbc can do file completion and line editing. 
    1742
    18 While the competition is on no work is being done on the cbc driver.  You
    19 should look at the samples.
    20 
    21 There are samples in ./Samples.  Use the corresponding Makefile to
     43There are samples in ./Samples.  Use make DRIVER=xxxxxx where xxxxxx.cpp is driver file to
    2244create an executable - testit.
    2345
    24 At present there are only two useful samples.
     46The two simplest samples are:
    2547
    2648sample.cpp  This is a simple program to read an mps file.and solve the
  • trunk/Test/CoinSolve.cpp

    r235 r237  
    7777#include "OsiClpSolverInterface.hpp"
    7878#ifdef CBC_AMPL
    79 #include "ampl.h"
     79#include "Cbc_ampl.h"
    8080static bool usingAmpl=false;
    8181#endif
     
    12461246                CoinCopyN(model2->dualRowSolution(),numberRows,info.dualSolution);
    12471247                CoinWarmStartBasis * basis = model2->getBasis();
     1248                free(info.rowStatus);
     1249                info.rowStatus = (int *) malloc(numberRows*sizeof(int));
     1250                free(info.columnStatus);
     1251                info.columnStatus = (int *) malloc(numberColumns*sizeof(int));
    12481252                // Put basis in
    12491253                int i;
  • trunk/Test/Makefile.solve

    r204 r237  
    6969TESTSRC += CbcOrClpParam.cpp
    7070TESTSRC += unitTestClp.cpp
     71TESTSRC2 := Cbc_ampl.c
    7172
    7273###############################################################################
     
    9192LDFLAGS += $(call ifprefix,$(SHLINKPREFIX),$(LIBDIRS))
    9293LDFLAGS += $(patsubst lib%,-l%,$(basename $(LIBS)))
     94#for Ampl
     95ifneq ($(origin CoinObjAmpl),undefined)
     96LDFLAGS +=  $(CoinObjAmpl)
     97endif
    9398
    9499ifeq ($(findstring Linux,${UNAME}),Linux)
     
    100105
    101106TESTOBJ := $(addprefix $(TARGETDIR)/, $(TESTSRC:.cpp=.o))
     107TESTOBJ += $(addprefix $(TARGETDIR)/, $(TESTSRC2:.c=.o))
    102108TESTDEP := $(addprefix $(DEPDIR)/, $(TESTSRC:.cpp=.d))
     109TESTDEP += $(addprefix $(DEPDIR)/, $(TESTSRC2:.c=.d))
    103110
    104111###############################################################################
Note: See TracChangeset for help on using the changeset viewer.