COIN-OR::LEMON - Graph Library

source: lemon-0.x/lemon/lp_skeleton.h @ 1895:5b01801efbc0

Last change on this file since 1895:5b01801efbc0 was 1895:5b01801efbc0, checked in by Alpar Juttner, 19 years ago
  • colName() added (untested on CPLEX)
  • possibility to set lower/upper bounds of several cols at once
  • setObj() -> obj()
  • setRow() -> row()
File size: 4.0 KB
Line 
1/* -*- C++ -*-
2 * lemon/lp_skeleton.h - Part of LEMON, a generic C++ optimization library
3 *
4 * Copyright (C) 2006 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
5 * (Egervary Research Group on Combinatorial Optimization, EGRES).
6 *
7 * Permission to use, modify and distribute this software is granted
8 * provided that this copyright notice appears in all copies. For
9 * precise terms see the accompanying LICENSE file.
10 *
11 * This software is provided "AS IS" with no warranty of any kind,
12 * express or implied, and with no claim as to its suitability for any
13 * purpose.
14 *
15 */
16
17#ifndef LEMON_LP_SKELETON
18#define LEMON_LP_SKELETON
19
20#include <lemon/lp_base.h>
21
22///\file
23///\brief A skeleton file to implement LP solver interfaces
24namespace lemon {
25
26  ///A skeleton class to implement LP solver interfaces
27  class LpSkeleton :public LpSolverBase {
28    int col_num,row_num;
29   
30  protected:
31    ///\e
32    virtual LpSolverBase &_newLp();
33    ///\e
34    virtual LpSolverBase &_copyLp();
35    /// \e
36    virtual int _addCol();
37    /// \e
38    virtual int _addRow();
39    /// \e
40    virtual void _eraseCol(int i);
41    /// \e
42    virtual void _eraseRow(int i);
43    /// \e
44    virtual void _getColName(int col,       std::string & name);
45    /// \e
46    virtual void _setColName(int col, const std::string & name);
47
48    /// \e
49
50    /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
51    ///
52    virtual void _setRowCoeffs(int i,
53                               int length,
54                               int  const * indices,
55                               Value  const * values );
56    /// \e
57
58    /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
59    ///
60    virtual void _setColCoeffs(int i,
61                               int length,
62                               int  const * indices,
63                               Value  const * values );
64   
65    /// Set one element of the coefficient matrix
66    virtual void _setCoeff(int row, int col, Value value);
67
68    /// The lower bound of a variable (column) have to be given by an
69    /// extended number of type Value, i.e. a finite number of type
70    /// Value or -\ref INF.
71    virtual void _setColLowerBound(int i, Value value);
72    /// \e
73
74    /// The upper bound of a variable (column) have to be given by an
75    /// extended number of type Value, i.e. a finite number of type
76    /// Value or \ref INF.
77    virtual void _setColUpperBound(int i, Value value);
78    /// \e
79
80//     /// The lower bound of a linear expression (row) have to be given by an
81//     /// extended number of type Value, i.e. a finite number of type
82//     /// Value or -\ref INF.
83//     virtual void _setRowLowerBound(int i, Value value);
84//     /// \e
85
86//     /// The upper bound of a linear expression (row) have to be given by an
87//     /// extended number of type Value, i.e. a finite number of type
88//     /// Value or \ref INF.
89//     virtual void _setRowUpperBound(int i, Value value);
90
91    /// The lower and upper bound of a linear expression (row) have to be
92    /// given by an
93    /// extended number of type Value, i.e. a finite number of type
94    /// Value or +/-\ref INF.
95    virtual void _setRowBounds(int i, Value lb, Value ub);
96    /// \e
97
98
99    /// \e
100    virtual void _clearObj();
101    /// \e
102    virtual void _setObjCoeff(int i, Value obj_coef);
103
104    ///\e
105   
106    ///\bug Wrong interface
107    ///
108    virtual SolveExitStatus _solve();
109
110    ///\e
111
112    ///\bug Wrong interface
113    ///
114    virtual Value _getPrimal(int i);
115
116    ///\e
117
118    ///\bug Wrong interface
119    ///
120    virtual Value _getDual(int i);
121
122    ///\e
123
124    ///\bug Wrong interface
125    ///
126    virtual Value _getPrimalValue();
127
128    ///\e
129
130    ///\bug Wrong interface
131    ///
132    virtual SolutionStatus _getPrimalStatus();
133
134    ////e
135    virtual SolutionStatus _getDualStatus();
136
137
138    ///\e
139    virtual ProblemTypes _getProblemType();
140
141    ///\e
142    virtual void _setMax();
143    ///\e
144    virtual void _setMin();
145
146    ///\e
147    virtual bool _isBasicCol(int i);
148
149   
150
151  public:
152    LpSkeleton() : LpSolverBase(), col_num(0), row_num(0) {}
153  }; 
154
155} //namespace lemon
156
157#endif // LEMON_LP_SKELETON
Note: See TracBrowser for help on using the repository browser.