COIN-OR::LEMON - Graph Library

source: lemon-0.x/src/lemon/lp_skeleton.h @ 1431:ad44b1dd8013

Last change on this file since 1431:ad44b1dd8013 was 1431:ad44b1dd8013, checked in by athos, 19 years ago

Added function _setCoeff().

File size: 3.5 KB
RevLine 
[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
25namespace 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:
[1364]32    ///\e
33    virtual LpSolverBase &_newLp();
34    ///\e
35    virtual LpSolverBase &_copyLp();
[1294]36    /// \e
[1254]37    virtual int _addCol();
[1294]38    /// \e
[1254]39    virtual int _addRow();
[1294]40    /// \e
41
42    /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
43    ///
[1254]44    virtual void _setRowCoeffs(int i,
45                               int length,
46                               int  const * indices,
47                               Value  const * values );
[1294]48    /// \e
49
50    /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
51    ///
[1254]52    virtual void _setColCoeffs(int i,
53                               int length,
54                               int  const * indices,
[1294]55                               Value  const * values );
56   
[1431]57    /// Set one element of the coefficient matrix
58    virtual void _setCoeff(int row, int col, Value value);
[1294]59
60    /// The lower bound of a variable (column) have to be given by an
61    /// extended number of type Value, i.e. a finite number of type
62    /// Value or -\ref INF.
[1254]63    virtual void _setColLowerBound(int i, Value value);
[1294]64    /// \e
65
66    /// The upper bound of a variable (column) have to be given by an
67    /// extended number of type Value, i.e. a finite number of type
68    /// Value or \ref INF.
[1254]69    virtual void _setColUpperBound(int i, Value value);
[1294]70    /// \e
71
[1405]72//     /// The lower bound of a linear expression (row) have to be given by an
73//     /// extended number of type Value, i.e. a finite number of type
74//     /// Value or -\ref INF.
75//     virtual void _setRowLowerBound(int i, Value value);
76//     /// \e
77
78//     /// The upper bound of a linear expression (row) have to be given by an
79//     /// extended number of type Value, i.e. a finite number of type
80//     /// Value or \ref INF.
81//     virtual void _setRowUpperBound(int i, Value value);
82
83    /// The lower and upper bound of a linear expression (row) have to be
84    /// given by an
[1294]85    /// extended number of type Value, i.e. a finite number of type
[1405]86    /// Value or +/-\ref INF.
[1389]87    virtual void _setRowBounds(int i, Value lb, Value ub);
88    /// \e
89
[1294]90
91    /// \e
[1390]92    virtual void _clearObj();
93    /// \e
[1254]94    virtual void _setObjCoeff(int i, Value obj_coef);
[1294]95
96    ///\e
97   
98    ///\bug Wrong interface
99    ///
[1303]100    virtual SolveExitStatus _solve();
[1294]101
102    ///\e
103
104    ///\bug Wrong interface
105    ///
[1293]106    virtual Value _getPrimal(int i);
[1294]107    ///\e
108
109    ///\bug Wrong interface
110    ///
[1312]111    virtual Value _getPrimalValue();
112    ///\e
113
114    ///\bug Wrong interface
115    ///
116    virtual SolutionStatus _getPrimalStatus();
117
118    ///\e
119    virtual void _setMax();
120    ///\e
121    virtual void _setMin();
122   
[1294]123
[1273]124  public:
[1313]125    LpSkeleton() : LpSolverBase(), col_num(0), row_num(0) {}
[1254]126  }; 
127
128} //namespace lemon
129
[1313]130#endif // LEMON_LP_SKELETON
Note: See TracBrowser for help on using the repository browser.