src/work/athos/lp/lp_solver_skeleton.h
changeset 1294 2dec219d9ca2
parent 1293 8ede2a6b2594
child 1303 9bcc455da4f5
equal deleted inserted replaced
3:d369a3714ee0 4:062362d47395
    27   ///A skeleton class to implement LP solver interfaces
    27   ///A skeleton class to implement LP solver interfaces
    28   class LpSolverSkeleton :public LpSolverBase {
    28   class LpSolverSkeleton :public LpSolverBase {
    29     int col_num,row_num;
    29     int col_num,row_num;
    30     
    30     
    31   protected:
    31   protected:
       
    32     /// \e
    32     virtual int _addCol();
    33     virtual int _addCol();
       
    34     /// \e
    33     virtual int _addRow();
    35     virtual int _addRow();
       
    36     /// \e
       
    37 
       
    38     /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
       
    39     ///
    34     virtual void _setRowCoeffs(int i, 
    40     virtual void _setRowCoeffs(int i, 
    35 			       int length,
    41 			       int length,
    36                                int  const * indices, 
    42                                int  const * indices, 
    37                                Value  const * values );
    43                                Value  const * values );
       
    44     /// \e
       
    45 
       
    46     /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
       
    47     ///
    38     virtual void _setColCoeffs(int i, 
    48     virtual void _setColCoeffs(int i, 
    39 			       int length,
    49 			       int length,
    40                                int  const * indices, 
    50                                int  const * indices, 
    41                                Value  const * values);
    51                                Value  const * values );
       
    52     
       
    53     /// \e
       
    54 
       
    55     /// The lower bound of a variable (column) have to be given by an 
       
    56     /// extended number of type Value, i.e. a finite number of type 
       
    57     /// Value or -\ref INF.
    42     virtual void _setColLowerBound(int i, Value value);
    58     virtual void _setColLowerBound(int i, Value value);
       
    59     /// \e
       
    60 
       
    61     /// The upper bound of a variable (column) have to be given by an 
       
    62     /// extended number of type Value, i.e. a finite number of type 
       
    63     /// Value or \ref INF.
    43     virtual void _setColUpperBound(int i, Value value);
    64     virtual void _setColUpperBound(int i, Value value);
       
    65     /// \e
       
    66 
       
    67     /// The lower bound of a linear expression (row) have to be given by an 
       
    68     /// extended number of type Value, i.e. a finite number of type 
       
    69     /// Value or -\ref INF.
    44     virtual void _setRowLowerBound(int i, Value value);
    70     virtual void _setRowLowerBound(int i, Value value);
       
    71     /// \e
       
    72 
       
    73     /// The upper bound of a linear expression (row) have to be given by an 
       
    74     /// extended number of type Value, i.e. a finite number of type 
       
    75     /// Value or \ref INF.
    45     virtual void _setRowUpperBound(int i, Value value);
    76     virtual void _setRowUpperBound(int i, Value value);
       
    77 
       
    78     /// \e
    46     virtual void _setObjCoeff(int i, Value obj_coef);
    79     virtual void _setObjCoeff(int i, Value obj_coef);
       
    80 
       
    81     ///\e
       
    82     
       
    83     ///\bug Wrong interface
       
    84     ///
    47     virtual SolutionStatus _solve();
    85     virtual SolutionStatus _solve();
       
    86 
       
    87     ///\e
       
    88 
       
    89     ///\bug Wrong interface
       
    90     ///
    48     virtual Value _getPrimal(int i);
    91     virtual Value _getPrimal(int i);
       
    92     ///\e
       
    93 
       
    94     ///\bug Wrong interface
       
    95     ///
       
    96     virtual SolutionType _getPrimalType();
       
    97 
    49   public:
    98   public:
    50     LpSolverSkeleton() : LpSolverBase(), col_num(0), row_num(0) {}
    99     LpSolverSkeleton() : LpSolverBase(), col_num(0), row_num(0) {}
    51   };  
   100   };  
    52 
   101 
    53 } //namespace lemon
   102 } //namespace lemon