lemon/lp_skeleton.cc
changeset 502 17cabb114d52
parent 458 7afc121e0689
child 540 9db62975c32b
equal deleted inserted replaced
0:aade35580536 1:1228907680b5
    20 
    20 
    21 ///\file
    21 ///\file
    22 ///\brief A skeleton file to implement LP solver interfaces
    22 ///\brief A skeleton file to implement LP solver interfaces
    23 namespace lemon {
    23 namespace lemon {
    24 
    24 
    25   LpSolverBase* LpSkeleton::_newLp()
    25   int SkeletonSolverBase::_addCol()
    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()
       
    38   {
    26   {
    39     return ++col_num;
    27     return ++col_num;
    40   }
    28   }
    41 
    29 
    42   int LpSkeleton::_addRow()
    30   int SkeletonSolverBase::_addRow()
    43   {
    31   {
    44     return ++row_num;
    32     return ++row_num;
    45   }
    33   }
    46 
    34 
    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;
    48   }
    85   }
    49 
    86 
    50   void LpSkeleton::_eraseRow(int) {
    87   LpSkeleton::SolveExitStatus LpSkeleton::_solve() { return SOLVED; }
    51   }
       
    52 
    88 
    53   void LpSkeleton::_getColName(int, std::string &) const {
    89   LpSkeleton::Value LpSkeleton::_getPrimal(int) const { return 0; }
    54   }
    90   LpSkeleton::Value LpSkeleton::_getDual(int) const { return 0; }
       
    91   LpSkeleton::Value LpSkeleton::_getPrimalValue() const { return 0; }
    55 
    92 
       
    93   LpSkeleton::Value LpSkeleton::_getPrimalRay(int) const { return 0; }
       
    94   LpSkeleton::Value LpSkeleton::_getDualRay(int) const { return 0; }
    56 
    95 
    57   void LpSkeleton::_setColName(int, const std::string &) {
    96   LpSkeleton::ProblemType LpSkeleton::_getPrimalType() const
    58   }
    97   { return UNDEFINED; }
    59 
    98 
    60   int LpSkeleton::_colByName(const std::string&) const { return -1; }
    99   LpSkeleton::ProblemType LpSkeleton::_getDualType() const
       
   100   { return UNDEFINED; }
    61 
   101 
       
   102   LpSkeleton::VarStatus LpSkeleton::_getColStatus(int) const
       
   103   { return BASIC; }
    62 
   104 
    63   void LpSkeleton::_setRowCoeffs(int, ConstRowIterator, ConstRowIterator) {
   105   LpSkeleton::VarStatus LpSkeleton::_getRowStatus(int) const
    64   }
   106   { return BASIC; }
    65 
   107 
    66   void LpSkeleton::_getRowCoeffs(int, RowIterator) const {
   108   LpSkeleton* LpSkeleton::_newSolver() const
    67   }
   109   { return static_cast<LpSkeleton*>(0); }
    68 
   110 
    69   void LpSkeleton::_setColCoeffs(int, ConstColIterator, ConstColIterator) {
   111   LpSkeleton* LpSkeleton::_cloneSolver() const
    70   }
   112   { return static_cast<LpSkeleton*>(0); }
    71 
   113 
    72   void LpSkeleton::_getColCoeffs(int, ColIterator) const {
   114   const char* LpSkeleton::_solverName() const { return "LpSkeleton"; }
    73   }
       
    74 
   115 
    75   void LpSkeleton::_setCoeff(int, int, Value )
   116   MipSkeleton::SolveExitStatus MipSkeleton::_solve()
    76   {
   117   { return SOLVED; }
    77   }
       
    78 
   118 
    79   LpSkeleton::Value LpSkeleton::_getCoeff(int, int) const
   119   MipSkeleton::Value MipSkeleton::_getSol(int) const { return 0; }
    80   {
   120   MipSkeleton::Value MipSkeleton::_getSolValue() const { return 0; }
    81     return 0;
       
    82   }
       
    83 
   121 
       
   122   MipSkeleton::ProblemType MipSkeleton::_getType() const
       
   123   { return UNDEFINED; }
    84 
   124 
    85   void LpSkeleton::_setColLowerBound(int, Value)
   125   MipSkeleton* MipSkeleton::_newSolver() const
    86   {
   126   { return static_cast<MipSkeleton*>(0); }
    87   }
       
    88 
   127 
    89   LpSkeleton::Value LpSkeleton::_getColLowerBound(int) const
   128   MipSkeleton* MipSkeleton::_cloneSolver() const
    90   {
   129   { return static_cast<MipSkeleton*>(0); }
    91     return 0;
       
    92   }
       
    93 
   130 
    94   void LpSkeleton::_setColUpperBound(int, Value)
   131   const char* MipSkeleton::_solverName() const { return "MipSkeleton"; }
    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   }
       
   185 
   132 
   186 } //namespace lemon
   133 } //namespace lemon
   187 
   134