COIN-OR::LEMON - Graph Library

Changeset 459:ed54c0d13df0 in lemon-main for lemon/lp_skeleton.cc


Ignore:
Timestamp:
12/02/08 22:48:28 (15 years ago)
Author:
Balazs Dezso <deba@…>
Branch:
default
Children:
460:76ec7bd57026, 513:17cabb114d52
Phase:
public
Message:

Thorough redesign of the LP/MIP interface (#44)

  • Redesigned class structure
  • Redesigned iterators
  • Some functions in the basic interface redesigned
  • More complete setting functions
  • Ray retrieving functions
  • Lot of improvements
  • Cplex common env
  • CLP macro definition to config.h.in
  • Update lp.h to also use soplex and clp
  • Remove default_solver_name
  • New solverName() function in solvers
  • Handle exceptions for MipCplex? test
  • Rename tolerance parameter to epsilon
  • Rename MapIt? to CoeffIt?
  • Lot of documentation improvements
  • Various bugfixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/lp_skeleton.cc

    r458 r459  
    2323namespace lemon {
    2424
    25   LpSolverBase* LpSkeleton::_newLp()
    26   {
    27     LpSolverBase *tmp=0;
    28     return tmp;
    29   }
    30 
    31   LpSolverBase* LpSkeleton::_copyLp()
    32   {
    33     LpSolverBase *tmp=0;
    34     return tmp;
    35   }
    36 
    37   int LpSkeleton::_addCol()
     25  int SkeletonSolverBase::_addCol()
    3826  {
    3927    return ++col_num;
    4028  }
    4129
    42   int LpSkeleton::_addRow()
     30  int SkeletonSolverBase::_addRow()
    4331  {
    4432    return ++row_num;
    4533  }
    4634
    47   void LpSkeleton::_eraseCol(int ) {
     35  void SkeletonSolverBase::_eraseCol(int) {}
     36  void SkeletonSolverBase::_eraseRow(int) {}
     37
     38  void SkeletonSolverBase::_getColName(int, std::string &) const {}
     39  void SkeletonSolverBase::_setColName(int, const std::string &) {}
     40  int SkeletonSolverBase::_colByName(const std::string&) const { return -1; }
     41
     42  void SkeletonSolverBase::_getRowName(int, std::string &) const {}
     43  void SkeletonSolverBase::_setRowName(int, const std::string &) {}
     44  int SkeletonSolverBase::_rowByName(const std::string&) const { return -1; }
     45
     46  void SkeletonSolverBase::_setRowCoeffs(int, ExprIterator, ExprIterator) {}
     47  void SkeletonSolverBase::_getRowCoeffs(int, InsertIterator) const {}
     48
     49  void SkeletonSolverBase::_setColCoeffs(int, ExprIterator, ExprIterator) {}
     50  void SkeletonSolverBase::_getColCoeffs(int, InsertIterator) const {}
     51
     52  void SkeletonSolverBase::_setCoeff(int, int, Value) {}
     53  SkeletonSolverBase::Value SkeletonSolverBase::_getCoeff(int, int) const
     54  { return 0; }
     55
     56  void SkeletonSolverBase::_setColLowerBound(int, Value) {}
     57  SkeletonSolverBase::Value SkeletonSolverBase::_getColLowerBound(int) const
     58  {  return 0; }
     59
     60  void SkeletonSolverBase::_setColUpperBound(int, Value) {}
     61  SkeletonSolverBase::Value SkeletonSolverBase::_getColUpperBound(int) const
     62  {  return 0; }
     63
     64  void SkeletonSolverBase::_setRowLowerBound(int, Value) {}
     65  SkeletonSolverBase::Value SkeletonSolverBase::_getRowLowerBound(int) const
     66  {  return 0; }
     67
     68  void SkeletonSolverBase::_setRowUpperBound(int, Value) {}
     69  SkeletonSolverBase::Value SkeletonSolverBase::_getRowUpperBound(int) const
     70  {  return 0; }
     71
     72  void SkeletonSolverBase::_setObjCoeffs(ExprIterator, ExprIterator) {}
     73  void SkeletonSolverBase::_getObjCoeffs(InsertIterator) const {};
     74
     75  void SkeletonSolverBase::_setObjCoeff(int, Value) {}
     76  SkeletonSolverBase::Value SkeletonSolverBase::_getObjCoeff(int) const
     77  {  return 0; }
     78
     79  void SkeletonSolverBase::_setSense(Sense) {}
     80  SkeletonSolverBase::Sense SkeletonSolverBase::_getSense() const
     81  { return MIN; }
     82
     83  void SkeletonSolverBase::_clear() {
     84    row_num = col_num = 0;
    4885  }
    4986
    50   void LpSkeleton::_eraseRow(int) {
    51   }
     87  LpSkeleton::SolveExitStatus LpSkeleton::_solve() { return SOLVED; }
    5288
    53   void LpSkeleton::_getColName(int, std::string &) const {
    54   }
     89  LpSkeleton::Value LpSkeleton::_getPrimal(int) const { return 0; }
     90  LpSkeleton::Value LpSkeleton::_getDual(int) const { return 0; }
     91  LpSkeleton::Value LpSkeleton::_getPrimalValue() const { return 0; }
    5592
     93  LpSkeleton::Value LpSkeleton::_getPrimalRay(int) const { return 0; }
     94  LpSkeleton::Value LpSkeleton::_getDualRay(int) const { return 0; }
    5695
    57   void LpSkeleton::_setColName(int, const std::string &) {
    58   }
     96  LpSkeleton::ProblemType LpSkeleton::_getPrimalType() const
     97  { return UNDEFINED; }
    5998
    60   int LpSkeleton::_colByName(const std::string&) const { return -1; }
     99  LpSkeleton::ProblemType LpSkeleton::_getDualType() const
     100  { return UNDEFINED; }
    61101
     102  LpSkeleton::VarStatus LpSkeleton::_getColStatus(int) const
     103  { return BASIC; }
    62104
    63   void LpSkeleton::_setRowCoeffs(int, ConstRowIterator, ConstRowIterator) {
    64   }
     105  LpSkeleton::VarStatus LpSkeleton::_getRowStatus(int) const
     106  { return BASIC; }
    65107
    66   void LpSkeleton::_getRowCoeffs(int, RowIterator) const {
    67   }
     108  LpSkeleton* LpSkeleton::_newSolver() const
     109  { return static_cast<LpSkeleton*>(0); }
    68110
    69   void LpSkeleton::_setColCoeffs(int, ConstColIterator, ConstColIterator) {
    70   }
     111  LpSkeleton* LpSkeleton::_cloneSolver() const
     112  { return static_cast<LpSkeleton*>(0); }
    71113
    72   void LpSkeleton::_getColCoeffs(int, ColIterator) const {
    73   }
     114  const char* LpSkeleton::_solverName() const { return "LpSkeleton"; }
    74115
    75   void LpSkeleton::_setCoeff(int, int, Value )
    76   {
    77   }
     116  MipSkeleton::SolveExitStatus MipSkeleton::_solve()
     117  { return SOLVED; }
    78118
    79   LpSkeleton::Value LpSkeleton::_getCoeff(int, int) const
    80   {
    81     return 0;
    82   }
     119  MipSkeleton::Value MipSkeleton::_getSol(int) const { return 0; }
     120  MipSkeleton::Value MipSkeleton::_getSolValue() const { return 0; }
    83121
     122  MipSkeleton::ProblemType MipSkeleton::_getType() const
     123  { return UNDEFINED; }
    84124
    85   void LpSkeleton::_setColLowerBound(int, Value)
    86   {
    87   }
     125  MipSkeleton* MipSkeleton::_newSolver() const
     126  { return static_cast<MipSkeleton*>(0); }
    88127
    89   LpSkeleton::Value LpSkeleton::_getColLowerBound(int) const
    90   {
    91     return 0;
    92   }
     128  MipSkeleton* MipSkeleton::_cloneSolver() const
     129  { return static_cast<MipSkeleton*>(0); }
    93130
    94   void LpSkeleton::_setColUpperBound(int, Value)
    95   {
    96   }
    97 
    98   LpSkeleton::Value LpSkeleton::_getColUpperBound(int) const
    99   {
    100     return 0;
    101   }
    102 
    103 //   void LpSkeleton::_setRowLowerBound(int, Value)
    104 //   {
    105 //   }
    106 
    107 //   void LpSkeleton::_setRowUpperBound(int, Value)
    108 //   {
    109 //   }
    110 
    111   void LpSkeleton::_setRowBounds(int, Value, Value)
    112   {
    113   }
    114 
    115   void LpSkeleton::_getRowBounds(int, Value&, Value&) const
    116   {
    117   }
    118 
    119   void LpSkeleton::_setObjCoeff(int, Value)
    120   {
    121   }
    122 
    123   LpSkeleton::Value LpSkeleton::_getObjCoeff(int) const
    124   {
    125     return 0;
    126   }
    127 
    128   void LpSkeleton::_setMax()
    129   {
    130   }
    131 
    132   void LpSkeleton::_setMin()
    133   {
    134   }
    135 
    136   bool LpSkeleton::_isMax() const
    137   {
    138     return true;
    139   }
    140 
    141 
    142   void LpSkeleton::_clearObj()
    143   {
    144   }
    145 
    146   LpSkeleton::SolveExitStatus LpSkeleton::_solve()
    147   {
    148     return SOLVED;
    149   }
    150 
    151   LpSkeleton::Value LpSkeleton::_getPrimal(int) const
    152   {
    153     return 0;
    154   }
    155 
    156   LpSkeleton::Value LpSkeleton::_getDual(int) const
    157   {
    158     return 0;
    159   }
    160 
    161   LpSkeleton::Value LpSkeleton::_getPrimalValue() const
    162   {
    163     return 0;
    164   }
    165 
    166   LpSkeleton::SolutionStatus LpSkeleton::_getPrimalStatus() const
    167   {
    168     return UNDEFINED;
    169   }
    170 
    171   LpSkeleton::SolutionStatus LpSkeleton::_getDualStatus() const
    172   {
    173     return UNDEFINED;
    174   }
    175 
    176   LpSkeleton::ProblemTypes LpSkeleton::_getProblemType() const
    177   {
    178     return UNKNOWN;
    179   }
    180 
    181   bool LpSkeleton::_isBasicCol(int) const
    182   {
    183     return true;
    184   }
     131  const char* MipSkeleton::_solverName() const { return "MipSkeleton"; }
    185132
    186133} //namespace lemon
Note: See TracChangeset for help on using the changeset viewer.