src/lemon/lp_cplex.h
author alpar
Thu, 19 May 2005 11:46:42 +0000
changeset 1428 9ba88ddc629c
parent 1398 2f21cc34a245
child 1431 ad44b1dd8013
permissions -rw-r--r--
A very simple xml parser
alpar@1381
     1
/* -*- C++ -*-
alpar@1381
     2
 * src/lemon/lp_cplex.h - Part of LEMON, a generic C++ optimization library
alpar@1381
     3
 *
alpar@1381
     4
 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
alpar@1381
     5
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
alpar@1381
     6
 *
alpar@1381
     7
 * Permission to use, modify and distribute this software is granted
alpar@1381
     8
 * provided that this copyright notice appears in all copies. For
alpar@1381
     9
 * precise terms see the accompanying LICENSE file.
alpar@1381
    10
 *
alpar@1381
    11
 * This software is provided "AS IS" with no warranty of any kind,
alpar@1381
    12
 * express or implied, and with no claim as to its suitability for any
alpar@1381
    13
 * purpose.
alpar@1381
    14
 *
alpar@1381
    15
 */
alpar@1381
    16
alpar@1381
    17
#ifndef LEMON_LP_CPLEX_H
alpar@1381
    18
#define LEMON_LP_CPLEX_H
alpar@1381
    19
alpar@1381
    20
///\file
alpar@1381
    21
///\brief Header of the LEMON-CPLEX lp solver interface.
alpar@1381
    22
alpar@1381
    23
#include <lemon/lp_base.h>
alpar@1398
    24
alpar@1381
    25
extern "C" {
alpar@1381
    26
#include <ilcplex/cplex.h>
alpar@1381
    27
}
alpar@1381
    28
alpar@1381
    29
namespace lemon {
alpar@1381
    30
alpar@1381
    31
alpar@1398
    32
  /// \brief Interface for the CPLEX solver
alpar@1381
    33
  /// 
alpar@1398
    34
  /// This class implements an interface for the CPLEX LP solver.
alpar@1381
    35
  class LpCplex : public LpSolverBase {
alpar@1381
    36
alpar@1381
    37
  public:
alpar@1381
    38
alpar@1381
    39
    typedef LpSolverBase Parent;
alpar@1381
    40
    
alpar@1381
    41
    /// \e
alpar@1381
    42
    int status;
alpar@1381
    43
    CPXENVptr env;
alpar@1381
    44
    CPXLPptr lp;
alpar@1381
    45
alpar@1381
    46
alpar@1381
    47
    /// \e
alpar@1381
    48
    LpCplex();
alpar@1381
    49
    /// \e
alpar@1381
    50
    ~LpCplex();
alpar@1381
    51
alpar@1381
    52
  protected:
alpar@1381
    53
    virtual LpSolverBase &_newLp();
alpar@1381
    54
    virtual LpSolverBase &_copyLp();
alpar@1381
    55
alpar@1381
    56
    virtual int _addCol();
alpar@1381
    57
    virtual int _addRow();
alpar@1381
    58
    virtual void _setRowCoeffs(int i, 
alpar@1381
    59
			       int length,
alpar@1381
    60
                               const int   * indices, 
alpar@1381
    61
                               const Value   * values );
alpar@1381
    62
    virtual void _setColCoeffs(int i, 
alpar@1381
    63
			       int length,
alpar@1381
    64
                               const int   * indices, 
alpar@1381
    65
                               const Value   * values);
alpar@1381
    66
    virtual void _setColLowerBound(int i, Value value);
alpar@1381
    67
    virtual void _setColUpperBound(int i, Value value);
athos@1405
    68
//     virtual void _setRowLowerBound(int i, Value value);
athos@1405
    69
//     virtual void _setRowUpperBound(int i, Value value);
alpar@1381
    70
    virtual void _setRowBounds(int i, Value lower, Value upper);
alpar@1381
    71
    virtual void _setObjCoeff(int i, Value obj_coef);
alpar@1381
    72
    virtual void _clearObj();
alpar@1381
    73
    ///\e
alpar@1381
    74
    
alpar@1381
    75
    ///\bug Unimplemented
alpar@1381
    76
    ///
alpar@1381
    77
    virtual SolveExitStatus _solve();
alpar@1381
    78
    ///\e
alpar@1381
    79
alpar@1381
    80
    ///\bug Unimplemented
alpar@1381
    81
    ///
alpar@1381
    82
    virtual Value _getPrimal(int i);
alpar@1381
    83
    ///\e
alpar@1381
    84
    
alpar@1381
    85
    ///\bug Unimplemented
alpar@1381
    86
    ///
alpar@1381
    87
    virtual Value _getPrimalValue();
alpar@1381
    88
    ///\e
alpar@1381
    89
    
alpar@1381
    90
    ///\bug Unimplemented
alpar@1381
    91
    ///
alpar@1381
    92
    virtual SolutionStatus _getPrimalStatus();
alpar@1381
    93
alpar@1381
    94
    ///\e
alpar@1381
    95
    
alpar@1381
    96
    ///\bug Unimplemented
alpar@1381
    97
    ///
alpar@1381
    98
    virtual void _setMax();
alpar@1381
    99
    ///\e
alpar@1381
   100
    
alpar@1381
   101
    ///\bug Unimplemented
alpar@1381
   102
    ///
alpar@1381
   103
    virtual void _setMin();
alpar@1381
   104
alpar@1381
   105
  };
alpar@1381
   106
} //END OF NAMESPACE LEMON
alpar@1381
   107
alpar@1381
   108
#endif //LEMON_LP_CPLEX_H
alpar@1381
   109