Changeset 32


Ignore:
Timestamp:
Oct 9, 2002 1:26:32 PM (17 years ago)
Author:
forrest
Message:

Samples to work

Location:
branches/devel-1/Samples
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-1/Samples/Makefile.defaults

    r10 r32  
    33# The location of the customized Makefiles
    44CoinDir := ../../
    5 export MakefileDir := $(CoinDir)/Common/make
     5export MakefileDir := $(CoinDir)/Makefiles
    66include ${MakefileDir}/Makefile.coin
    77include ${MakefileDir}/Makefile.location
    88
    99IncDir :=
    10 IncDir += ${OsiSolverIncDir}
    11 IncDir += ${OsiIncDir}
     10IncDir += ${CoinIncDir}
    1211IncDir += ${ClpIncDir}
    1312IncDir += ${zlibIncDir}
     
    1514
    1615LibDir :=
    17 LibDir += ${OsiLibDir}
     16LibDir += ${CoinLibDir}
    1817LibDir += ${ClpLibDir}
    1918LibDir += ${zlibLibDir}
     
    2120
    2221LibName :=
    23 LibName += ${OsiLibName}
     22LibName += ${CoinLibName}
    2423LibName += ${ClpLibName}
    2524LibName += ${zlibLibName}
     
    2827Define :=
    2928Define += ${ClpDefine}
    30 Define += ${OsiDefine}
     29Define += ${CoinDefine}
    3130Define += ${zlibDefine}
    3231Define += ${bzlibDefine}
     
    8988        @rm -f $@
    9089        $(CXX) $(CXXFLAGS) -o $@ $(TESTOBJ) $(LDFLAGS) $(SYSLD) -lm
    91         ${CP} $@ ..
     90#       ${CP} $@ ..
    9291
    9392###############################################################################
  • branches/devel-1/Samples/Makefile.minimum

    r2 r32  
    33# The location of the customized Makefiles
    44CoinDir := ../../
    5 export MakefileDir := $(CoinDir)/Common/make
     5export MakefileDir := $(CoinDir)/Makefiles
    66include ${MakefileDir}/Makefile.coin
    77include ${MakefileDir}/Makefile.location
    88
    99IncDir :=
    10 IncDir += ${OsiSolverIncDir}
    11 IncDir += ${OsiIncDir}
     10IncDir += ${CoinIncDir}
    1211IncDir += ${ClpIncDir}
    1312IncDir += ${zlibIncDir}
     
    1514
    1615LibDir :=
    17 LibDir += ${OsiLibDir}
     16LibDir += ${CoinLibDir}
    1817LibDir += ${ClpLibDir}
    1918LibDir += ${zlibLibDir}
     
    2120
    2221LibName :=
    23 LibName += ${OsiLibName}
     22LibName += ${CoinLibName}
    2423LibName += ${ClpLibName}
    2524LibName += ${zlibLibName}
     
    2827Define :=
    2928Define += ${ClpDefine}
    30 Define += ${OsiDefine}
     29Define += ${CoinDefine}
    3130Define += ${zlibDefine}
    3231Define += ${bzlibDefine}
     
    8988        @rm -f $@
    9089        $(CXX) $(CXXFLAGS) -o $@ $(TESTOBJ) $(LDFLAGS) $(SYSLD) -lm
    91         ${CP} $@ ..
     90#       ${CP} $@ ..
    9291
    9392###############################################################################
  • branches/devel-1/Samples/defaults.cpp

    r11 r32  
    33
    44#include "ClpSimplex.hpp"
    5 #include "OsiWarmStartBasis.hpp"
    65#include "ClpPrimalColumnSteepest.hpp"
    76#include "ClpDualRowSteepest.hpp"
     
    4746  // Number of rows and columns - also getNumRows, getNumCols
    4847  std::string modelName;
    49   model.getStrParam(OsiProbName,modelName);
     48  model.getStrParam(ClpProbName,modelName);
    5049  std::cout<<"Model "<<modelName<<" has "<<model.numberRows()<<" rows and "<<
    5150    model.numberColumns()<<" columns"<<std::endl;
     
    5554     primalTolerance and setPrimalTolerance may be used as well */
    5655
    57   model.getDblParam(OsiDualObjectiveLimit,value);
    58   std::cout<<"Value of OsiDualObjectiveLimit is "<<value<<std::endl;
    59   model.getDblParam(OsiPrimalObjectiveLimit,value);
    60   std::cout<<"Value of OsiPrimalObjectiveLimit is "<<value<<std::endl;
    61   model.getDblParam(OsiDualTolerance,value);
    62   std::cout<<"Value of OsiDualTolerance is "<<value<<std::endl;
    63   model.getDblParam(OsiPrimalTolerance,value);
    64   std::cout<<"Value of OsiPrimalTolerance is "<<value<<std::endl;
    65   model.getDblParam(OsiObjOffset,value);
    66   std::cout<<"Value of OsiObjOffset is "<<value<<std::endl;
    67 
    68   // setDblParam(OsiPrimalTolerance) is same as this
    69   model.getDblParam(OsiPrimalTolerance,value);
     56  model.getDblParam(ClpDualObjectiveLimit,value);
     57  std::cout<<"Value of ClpDualObjectiveLimit is "<<value<<std::endl;
     58  model.getDblParam(ClpPrimalObjectiveLimit,value);
     59  std::cout<<"Value of ClpPrimalObjectiveLimit is "<<value<<std::endl;
     60  model.getDblParam(ClpDualTolerance,value);
     61  std::cout<<"Value of ClpDualTolerance is "<<value<<std::endl;
     62  model.getDblParam(ClpPrimalTolerance,value);
     63  std::cout<<"Value of ClpPrimalTolerance is "<<value<<std::endl;
     64  model.getDblParam(ClpObjOffset,value);
     65  std::cout<<"Value of ClpObjOffset is "<<value<<std::endl;
     66
     67  // setDblParam(ClpPrimalTolerance) is same as this
     68  model.getDblParam(ClpPrimalTolerance,value);
    7069  model.setPrimalTolerance(value);
    7170
     
    7574
    7675  // Can also use maximumIterations
    77   model.getIntParam(OsiMaxNumIteration,integerValue);
    78   std::cout<<"Value of OsiMaxNumIteration is "<<integerValue<<std::endl;
     76  model.getIntParam(ClpMaxNumIteration,integerValue);
     77  std::cout<<"Value of ClpMaxNumIteration is "<<integerValue<<std::endl;
    7978  model.setMaximumIterations(integerValue);
    8079
    8180  // Not sure this works yet
    82   model.getIntParam(OsiMaxNumIterationHotStart,integerValue);
    83   std::cout<<"Value of OsiMaxNumIterationHotStart is "
     81  model.getIntParam(ClpMaxNumIterationHotStart,integerValue);
     82  std::cout<<"Value of ClpMaxNumIterationHotStart is "
    8483           <<integerValue<<std::endl;
    8584
     
    114113
    115114  // Save warm start and set to all slack
    116   OsiWarmStartBasis basis1 = model.getBasis();
    117   OsiWarmStartBasis allSlack;
    118   model.setBasis(allSlack);
     115  unsigned char * basis1 = model.statusCopy();
     116  model.createStatus();
    119117
    120118  // Now create another model and do hot start
    121119  ClpSimplex model2=model;
    122   model2.setBasis(basis1);
     120  model2.copyinStatus(basis1);
     121  delete [] basis1;
    123122
    124123  // Check model has not got basis (should iterate)
     
    146145  // Do some deafult message handling
    147146  // To see real use - see OsiOslSolverInterfaceTest.cpp
    148   OsiMessageHandler handler;
     147  CoinMessageHandler handler;
    149148  model2.passInMessageHandler(& handler);
    150   model2.newLanguage(OsiMessages::us_en);
     149  model2.newLanguage(CoinMessages::us_en);
    151150
    152151  //Increase level of detail
     
    306305
    307306  // Now matrix
    308   OsiPackedMatrix * matrix = model2.matrix();
     307  CoinPackedMatrix * matrix = model2.matrix();
    309308
    310309  const double * element = matrix->getElements();
Note: See TracChangeset for help on using the changeset viewer.