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