src/work/athos/lp/lp_base.h
author athos
Wed, 23 Mar 2005 12:30:33 +0000
changeset 1249 66b54d071a60
parent 1247 60708e1475ae
child 1251 8f7ce70899e6
permissions -rw-r--r--
An alternative of lp_base.h.
athos@1247
     1
/* -*- C++ -*-
athos@1247
     2
 * src/lemon/maps.h - Part of LEMON, a generic C++ optimization library
athos@1247
     3
 *
athos@1247
     4
 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
athos@1247
     5
 * (Egervary Combinatorial Optimization Research Group, EGRES).
athos@1247
     6
 *
athos@1247
     7
 * Permission to use, modify and distribute this software is granted
athos@1247
     8
 * provided that this copyright notice appears in all copies. For
athos@1247
     9
 * precise terms see the accompanying LICENSE file.
athos@1247
    10
 *
athos@1247
    11
 * This software is provided "AS IS" with no warranty of any kind,
athos@1247
    12
 * express or implied, and with no claim as to its suitability for any
athos@1247
    13
 * purpose.
athos@1247
    14
 *
athos@1247
    15
 */
athos@1247
    16
athos@1246
    17
#ifndef LEMON_LP_BASE_H
athos@1246
    18
#define LEMON_LP_BASE_H
athos@1246
    19
athos@1246
    20
///\file
athos@1246
    21
///\brief The interface of the LP solver interface.
athos@1246
    22
namespace lemon {
athos@1246
    23
  class LpSolverBase {
athos@1247
    24
  public:
athos@1247
    25
athos@1247
    26
    //UNCATEGORIZED
athos@1247
    27
athos@1247
    28
    /// \e
athos@1247
    29
    typedef double Value;
athos@1247
    30
    /// \e 
athos@1247
    31
    static const Value INF;
athos@1247
    32
   protected:
athos@1246
    33
athos@1246
    34
    //MATRIX MANIPULATING FUNCTIONS
athos@1246
    35
athos@1246
    36
    /// \e
athos@1246
    37
    virtual int _addCol() = 0;
athos@1246
    38
    /// \e
athos@1246
    39
    virtual int _addRow() = 0;
athos@1246
    40
    /// \e
athos@1246
    41
    /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
athos@1246
    42
    virtual void _setRowCoeffs(int i, 
athos@1247
    43
                               int  const * indices, 
athos@1247
    44
                               Value  const * values ) = 0;
athos@1246
    45
    /// \e
athos@1246
    46
    /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
athos@1246
    47
    virtual void _setColCoeffs(int i, 
athos@1247
    48
                               int  const * indices, 
athos@1247
    49
                               Value  const * values ) = 0;
athos@1246
    50
    
athos@1247
    51
    /// \e
athos@1247
    52
    /// The lower bound of a variable (column) have to be given by an 
athos@1247
    53
    /// extended number of type Value, i.e. a finite number of type 
athos@1247
    54
    /// Value or -INF.
athos@1247
    55
    virtual void _setColLowerBound(int i, Value value) = 0;
athos@1247
    56
    /// \e
athos@1247
    57
    /// The upper bound of a variable (column) have to be given by an 
athos@1247
    58
    /// extended number of type Value, i.e. a finite number of type 
athos@1247
    59
    /// Value or INF.
athos@1247
    60
    virtual void _setColUpperBound(int i, Value value) = 0;
athos@1247
    61
    /// \e
athos@1247
    62
    /// The lower bound of a linear expression (row) have to be given by an 
athos@1247
    63
    /// extended number of type Value, i.e. a finite number of type 
athos@1247
    64
    /// Value or -INF.
athos@1247
    65
    virtual void _setRowLowerBound(int i, Value value) = 0;
athos@1247
    66
    /// \e
athos@1247
    67
    /// The upper bound of a linear expression (row) have to be given by an 
athos@1247
    68
    /// extended number of type Value, i.e. a finite number of type 
athos@1247
    69
    /// Value or INF.
athos@1247
    70
    virtual void _setRowUpperBound(int i, Value value) = 0;
athos@1247
    71
athos@1247
    72
    /// \e
athos@1247
    73
    virtual void _setObjCoeff(int i, Value obj_coef) = 0;
athos@1248
    74
  };  
athos@1246
    75
athos@1246
    76
} //namespace lemon
athos@1246
    77
athos@1246
    78
#endif //LEMON_LP_BASE_H