[1254] | 1 | /* -*- C++ -*- |
---|
[1313] | 2 | * src/lemon/lp_skeleton.h |
---|
[1254] | 3 | * - Part of LEMON, a generic C++ optimization library |
---|
| 4 | * |
---|
| 5 | * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
---|
[1359] | 6 | * (Egervary Research Group on Combinatorial Optimization, EGRES). |
---|
[1254] | 7 | * |
---|
| 8 | * Permission to use, modify and distribute this software is granted |
---|
| 9 | * provided that this copyright notice appears in all copies. For |
---|
| 10 | * precise terms see the accompanying LICENSE file. |
---|
| 11 | * |
---|
| 12 | * This software is provided "AS IS" with no warranty of any kind, |
---|
| 13 | * express or implied, and with no claim as to its suitability for any |
---|
| 14 | * purpose. |
---|
| 15 | * |
---|
| 16 | */ |
---|
| 17 | |
---|
[1313] | 18 | #ifndef LEMON_LP_SKELETON |
---|
| 19 | #define LEMON_LP_SKELETON |
---|
[1254] | 20 | |
---|
[1356] | 21 | #include <lemon/lp_base.h> |
---|
[1254] | 22 | |
---|
| 23 | ///\file |
---|
| 24 | ///\brief A skeleton file to implement LP solver interfaces |
---|
| 25 | namespace lemon { |
---|
| 26 | |
---|
| 27 | ///A skeleton class to implement LP solver interfaces |
---|
[1313] | 28 | class LpSkeleton :public LpSolverBase { |
---|
[1273] | 29 | int col_num,row_num; |
---|
| 30 | |
---|
[1254] | 31 | protected: |
---|
[1294] | 32 | /// \e |
---|
[1254] | 33 | virtual int _addCol(); |
---|
[1294] | 34 | /// \e |
---|
[1254] | 35 | virtual int _addRow(); |
---|
[1294] | 36 | /// \e |
---|
| 37 | |
---|
| 38 | /// \warning Arrays are indexed from 1 (datum at index 0 is ignored) |
---|
| 39 | /// |
---|
[1254] | 40 | virtual void _setRowCoeffs(int i, |
---|
| 41 | int length, |
---|
| 42 | int const * indices, |
---|
| 43 | Value const * values ); |
---|
[1294] | 44 | /// \e |
---|
| 45 | |
---|
| 46 | /// \warning Arrays are indexed from 1 (datum at index 0 is ignored) |
---|
| 47 | /// |
---|
[1254] | 48 | virtual void _setColCoeffs(int i, |
---|
| 49 | int length, |
---|
| 50 | int const * indices, |
---|
[1294] | 51 | Value const * values ); |
---|
| 52 | |
---|
| 53 | /// \e |
---|
| 54 | |
---|
| 55 | /// The lower bound of a variable (column) have to be given by an |
---|
| 56 | /// extended number of type Value, i.e. a finite number of type |
---|
| 57 | /// Value or -\ref INF. |
---|
[1254] | 58 | virtual void _setColLowerBound(int i, Value value); |
---|
[1294] | 59 | /// \e |
---|
| 60 | |
---|
| 61 | /// The upper bound of a variable (column) have to be given by an |
---|
| 62 | /// extended number of type Value, i.e. a finite number of type |
---|
| 63 | /// Value or \ref INF. |
---|
[1254] | 64 | virtual void _setColUpperBound(int i, Value value); |
---|
[1294] | 65 | /// \e |
---|
| 66 | |
---|
| 67 | /// The lower bound of a linear expression (row) have to be given by an |
---|
| 68 | /// extended number of type Value, i.e. a finite number of type |
---|
| 69 | /// Value or -\ref INF. |
---|
[1254] | 70 | virtual void _setRowLowerBound(int i, Value value); |
---|
[1294] | 71 | /// \e |
---|
| 72 | |
---|
| 73 | /// The upper bound of a linear expression (row) have to be given by an |
---|
| 74 | /// extended number of type Value, i.e. a finite number of type |
---|
| 75 | /// Value or \ref INF. |
---|
[1254] | 76 | virtual void _setRowUpperBound(int i, Value value); |
---|
[1294] | 77 | |
---|
| 78 | /// \e |
---|
[1254] | 79 | virtual void _setObjCoeff(int i, Value obj_coef); |
---|
[1294] | 80 | |
---|
| 81 | ///\e |
---|
| 82 | |
---|
| 83 | ///\bug Wrong interface |
---|
| 84 | /// |
---|
[1303] | 85 | virtual SolveExitStatus _solve(); |
---|
[1294] | 86 | |
---|
| 87 | ///\e |
---|
| 88 | |
---|
| 89 | ///\bug Wrong interface |
---|
| 90 | /// |
---|
[1293] | 91 | virtual Value _getPrimal(int i); |
---|
[1294] | 92 | ///\e |
---|
| 93 | |
---|
| 94 | ///\bug Wrong interface |
---|
| 95 | /// |
---|
[1312] | 96 | virtual Value _getPrimalValue(); |
---|
| 97 | ///\e |
---|
| 98 | |
---|
| 99 | ///\bug Wrong interface |
---|
| 100 | /// |
---|
| 101 | virtual SolutionStatus _getPrimalStatus(); |
---|
| 102 | |
---|
| 103 | ///\e |
---|
| 104 | virtual void _setMax(); |
---|
| 105 | ///\e |
---|
| 106 | virtual void _setMin(); |
---|
| 107 | |
---|
[1294] | 108 | |
---|
[1273] | 109 | public: |
---|
[1313] | 110 | LpSkeleton() : LpSolverBase(), col_num(0), row_num(0) {} |
---|
[1254] | 111 | }; |
---|
| 112 | |
---|
| 113 | } //namespace lemon |
---|
| 114 | |
---|
[1313] | 115 | #endif // LEMON_LP_SKELETON |
---|