src/work/athos/lp/lp_base.h
author marci
Wed, 23 Mar 2005 16:59:13 +0000
changeset 1252 4fee8e9d9014
parent 1248 ca613a9e3567
child 1253 609fe893df8c
permissions -rw-r--r--
documentation
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@1251
    43
			       int length,
athos@1247
    44
                               int  const * indices, 
athos@1247
    45
                               Value  const * values ) = 0;
athos@1246
    46
    /// \e
athos@1246
    47
    /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
athos@1246
    48
    virtual void _setColCoeffs(int i, 
athos@1251
    49
			       int length,
athos@1247
    50
                               int  const * indices, 
athos@1247
    51
                               Value  const * values ) = 0;
athos@1246
    52
    
athos@1247
    53
    /// \e
athos@1247
    54
    /// The lower bound of a variable (column) have to be given by an 
athos@1247
    55
    /// extended number of type Value, i.e. a finite number of type 
athos@1247
    56
    /// Value or -INF.
athos@1247
    57
    virtual void _setColLowerBound(int i, Value value) = 0;
athos@1247
    58
    /// \e
athos@1247
    59
    /// The upper bound of a variable (column) have to be given by an 
athos@1247
    60
    /// extended number of type Value, i.e. a finite number of type 
athos@1247
    61
    /// Value or INF.
athos@1247
    62
    virtual void _setColUpperBound(int i, Value value) = 0;
athos@1247
    63
    /// \e
athos@1247
    64
    /// The lower bound of a linear expression (row) have to be given by an 
athos@1247
    65
    /// extended number of type Value, i.e. a finite number of type 
athos@1247
    66
    /// Value or -INF.
athos@1247
    67
    virtual void _setRowLowerBound(int i, Value value) = 0;
athos@1247
    68
    /// \e
athos@1247
    69
    /// The upper bound of a linear expression (row) have to be given by an 
athos@1247
    70
    /// extended number of type Value, i.e. a finite number of type 
athos@1247
    71
    /// Value or INF.
athos@1247
    72
    virtual void _setRowUpperBound(int i, Value value) = 0;
athos@1247
    73
athos@1247
    74
    /// \e
athos@1247
    75
    virtual void _setObjCoeff(int i, Value obj_coef) = 0;
athos@1248
    76
  };  
athos@1246
    77
athos@1246
    78
} //namespace lemon
athos@1246
    79
athos@1246
    80
#endif //LEMON_LP_BASE_H