LpSolverSkeleton -> LpSkeleton
authoralpar
Thu, 07 Apr 2005 06:38:56 +0000
changeset 131396b74270c3a1
parent 1312 48f9299b390d
child 1314 9269c76551cf
LpSolverSkeleton -> LpSkeleton
lp_solver_skeleton* -> lp_skeleton*
src/lemon/Makefile.am
src/lemon/lp_skeleton.cc
src/lemon/lp_skeleton.h
src/lemon/lp_solver_skeleton.cc
src/lemon/lp_solver_skeleton.h
src/test/lp_test.cc
     1.1 --- a/src/lemon/Makefile.am	Thu Apr 07 06:31:03 2005 +0000
     1.2 +++ b/src/lemon/Makefile.am	Thu Apr 07 06:38:56 2005 +0000
     1.3 @@ -7,7 +7,7 @@
     1.4  libemon_la_SOURCES =							\
     1.5  	lp_base.cc							\
     1.6  	lp_glpk.cc							\
     1.7 -	lp_solver_skeleton.cc
     1.8 +	lp_skeleton.cc
     1.9  
    1.10  pkginclude_HEADERS =							\
    1.11  	bezier.h							\
    1.12 @@ -56,7 +56,7 @@
    1.13  noinst_HEADERS =							\
    1.14  	lp_base.h							\
    1.15  	lp_glpk.h							\
    1.16 -	lp_solver_skeleton.h						\
    1.17 +	lp_skeleton.h						\
    1.18  	concept/graph.h							\
    1.19  	concept/graph_component.h					\
    1.20  	concept/undir_graph.h						\
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/lemon/lp_skeleton.cc	Thu Apr 07 06:38:56 2005 +0000
     2.3 @@ -0,0 +1,96 @@
     2.4 +/* -*- C++ -*-
     2.5 + * src/lemon/lp_skeleton.cc
     2.6 + * - Part of LEMON, a generic C++ optimization library
     2.7 + *
     2.8 + * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     2.9 + * (Egervary Combinatorial Optimization Research Group, EGRES).
    2.10 + *
    2.11 + * Permission to use, modify and distribute this software is granted
    2.12 + * provided that this copyright notice appears in all copies. For
    2.13 + * precise terms see the accompanying LICENSE file.
    2.14 + *
    2.15 + * This software is provided "AS IS" with no warranty of any kind,
    2.16 + * express or implied, and with no claim as to its suitability for any
    2.17 + * purpose.
    2.18 + *
    2.19 + */
    2.20 +
    2.21 +#include <lemon/lp_skeleton.h>
    2.22 +
    2.23 +///\file
    2.24 +///\brief A skeleton file to implement LP solver interfaces
    2.25 +namespace lemon {
    2.26 +  
    2.27 +  int LpSkeleton::_addCol()
    2.28 +  {
    2.29 +    return ++col_num;
    2.30 +  }
    2.31 +  
    2.32 +  int LpSkeleton::_addRow() 
    2.33 +  {
    2.34 +    return ++row_num;
    2.35 +  }
    2.36 +  
    2.37 +  void LpSkeleton::_setRowCoeffs(int i, 
    2.38 +					       int length,
    2.39 +					       int  const * indices, 
    2.40 +					       Value  const * values )
    2.41 +  {
    2.42 +  }
    2.43 +  
    2.44 +  void LpSkeleton::_setColCoeffs(int i, 
    2.45 +					       int length,
    2.46 +					       int  const * indices, 
    2.47 +					       Value  const * values)
    2.48 +  {
    2.49 +  }
    2.50 +  
    2.51 +  void LpSkeleton::_setColLowerBound(int i, Value value)
    2.52 +  {
    2.53 +  }
    2.54 +  
    2.55 +  void LpSkeleton::_setColUpperBound(int i, Value value)
    2.56 +  {
    2.57 +  }
    2.58 +  
    2.59 +  void LpSkeleton::_setRowLowerBound(int i, Value value)
    2.60 +  {
    2.61 +  }
    2.62 +  
    2.63 +  void LpSkeleton::_setRowUpperBound(int i, Value value)
    2.64 +  {
    2.65 +  }
    2.66 +  
    2.67 +  void LpSkeleton::_setObjCoeff(int i, Value obj_coef)
    2.68 +  {
    2.69 +  }
    2.70 +
    2.71 +  void LpSkeleton::_setMax()
    2.72 +  {
    2.73 +  }
    2.74 +  void LpSkeleton::_setMin()
    2.75 +  {
    2.76 +  }
    2.77 +
    2.78 +  LpSkeleton::SolveExitStatus LpSkeleton::_solve()
    2.79 +  {
    2.80 +    return SOLVED;
    2.81 +  }
    2.82 +
    2.83 +  LpSkeleton::Value LpSkeleton::_getPrimal(int i)
    2.84 +  {
    2.85 +    return 0;
    2.86 +  }
    2.87 +  
    2.88 +  LpSkeleton::Value LpSkeleton::_getPrimalValue()
    2.89 +  {
    2.90 +    return 0;
    2.91 +  }
    2.92 +  
    2.93 +  LpSkeleton::SolutionStatus LpSkeleton::_getPrimalStatus()
    2.94 +  {
    2.95 +    return OPTIMAL;
    2.96 +  }
    2.97 +  
    2.98 +} //namespace lemon
    2.99 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/src/lemon/lp_skeleton.h	Thu Apr 07 06:38:56 2005 +0000
     3.3 @@ -0,0 +1,115 @@
     3.4 +/* -*- C++ -*-
     3.5 + * src/lemon/lp_skeleton.h
     3.6 + * - Part of LEMON, a generic C++ optimization library
     3.7 + *
     3.8 + * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     3.9 + * (Egervary Combinatorial Optimization Research Group, EGRES).
    3.10 + *
    3.11 + * Permission to use, modify and distribute this software is granted
    3.12 + * provided that this copyright notice appears in all copies. For
    3.13 + * precise terms see the accompanying LICENSE file.
    3.14 + *
    3.15 + * This software is provided "AS IS" with no warranty of any kind,
    3.16 + * express or implied, and with no claim as to its suitability for any
    3.17 + * purpose.
    3.18 + *
    3.19 + */
    3.20 +
    3.21 +#ifndef LEMON_LP_SKELETON
    3.22 +#define LEMON_LP_SKELETON
    3.23 +
    3.24 +#include"lp_base.h"
    3.25 +
    3.26 +///\file
    3.27 +///\brief A skeleton file to implement LP solver interfaces
    3.28 +namespace lemon {
    3.29 +  
    3.30 +  ///A skeleton class to implement LP solver interfaces
    3.31 +  class LpSkeleton :public LpSolverBase {
    3.32 +    int col_num,row_num;
    3.33 +    
    3.34 +  protected:
    3.35 +    /// \e
    3.36 +    virtual int _addCol();
    3.37 +    /// \e
    3.38 +    virtual int _addRow();
    3.39 +    /// \e
    3.40 +
    3.41 +    /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
    3.42 +    ///
    3.43 +    virtual void _setRowCoeffs(int i, 
    3.44 +			       int length,
    3.45 +                               int  const * indices, 
    3.46 +                               Value  const * values );
    3.47 +    /// \e
    3.48 +
    3.49 +    /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
    3.50 +    ///
    3.51 +    virtual void _setColCoeffs(int i, 
    3.52 +			       int length,
    3.53 +                               int  const * indices, 
    3.54 +                               Value  const * values );
    3.55 +    
    3.56 +    /// \e
    3.57 +
    3.58 +    /// The lower bound of a variable (column) have to be given by an 
    3.59 +    /// extended number of type Value, i.e. a finite number of type 
    3.60 +    /// Value or -\ref INF.
    3.61 +    virtual void _setColLowerBound(int i, Value value);
    3.62 +    /// \e
    3.63 +
    3.64 +    /// The upper bound of a variable (column) have to be given by an 
    3.65 +    /// extended number of type Value, i.e. a finite number of type 
    3.66 +    /// Value or \ref INF.
    3.67 +    virtual void _setColUpperBound(int i, Value value);
    3.68 +    /// \e
    3.69 +
    3.70 +    /// The lower bound of a linear expression (row) have to be given by an 
    3.71 +    /// extended number of type Value, i.e. a finite number of type 
    3.72 +    /// Value or -\ref INF.
    3.73 +    virtual void _setRowLowerBound(int i, Value value);
    3.74 +    /// \e
    3.75 +
    3.76 +    /// The upper bound of a linear expression (row) have to be given by an 
    3.77 +    /// extended number of type Value, i.e. a finite number of type 
    3.78 +    /// Value or \ref INF.
    3.79 +    virtual void _setRowUpperBound(int i, Value value);
    3.80 +
    3.81 +    /// \e
    3.82 +    virtual void _setObjCoeff(int i, Value obj_coef);
    3.83 +
    3.84 +    ///\e
    3.85 +    
    3.86 +    ///\bug Wrong interface
    3.87 +    ///
    3.88 +    virtual SolveExitStatus _solve();
    3.89 +
    3.90 +    ///\e
    3.91 +
    3.92 +    ///\bug Wrong interface
    3.93 +    ///
    3.94 +    virtual Value _getPrimal(int i);
    3.95 +    ///\e
    3.96 +
    3.97 +    ///\bug Wrong interface
    3.98 +    ///
    3.99 +    virtual Value _getPrimalValue();
   3.100 +    ///\e
   3.101 +
   3.102 +    ///\bug Wrong interface
   3.103 +    ///
   3.104 +    virtual SolutionStatus _getPrimalStatus();
   3.105 +
   3.106 +    ///\e
   3.107 +    virtual void _setMax();
   3.108 +    ///\e
   3.109 +    virtual void _setMin();
   3.110 +    
   3.111 +
   3.112 +  public:
   3.113 +    LpSkeleton() : LpSolverBase(), col_num(0), row_num(0) {}
   3.114 +  };  
   3.115 +
   3.116 +} //namespace lemon
   3.117 +
   3.118 +#endif // LEMON_LP_SKELETON
     4.1 --- a/src/lemon/lp_solver_skeleton.cc	Thu Apr 07 06:31:03 2005 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,96 +0,0 @@
     4.4 -/* -*- C++ -*-
     4.5 - * src/lemon/lp_solver_skeleton.cc
     4.6 - * - Part of LEMON, a generic C++ optimization library
     4.7 - *
     4.8 - * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     4.9 - * (Egervary Combinatorial Optimization Research Group, EGRES).
    4.10 - *
    4.11 - * Permission to use, modify and distribute this software is granted
    4.12 - * provided that this copyright notice appears in all copies. For
    4.13 - * precise terms see the accompanying LICENSE file.
    4.14 - *
    4.15 - * This software is provided "AS IS" with no warranty of any kind,
    4.16 - * express or implied, and with no claim as to its suitability for any
    4.17 - * purpose.
    4.18 - *
    4.19 - */
    4.20 -
    4.21 -#include <lemon/lp_solver_skeleton.h>
    4.22 -
    4.23 -///\file
    4.24 -///\brief A skeleton file to implement LP solver interfaces
    4.25 -namespace lemon {
    4.26 -  
    4.27 -  int LpSolverSkeleton::_addCol()
    4.28 -  {
    4.29 -    return ++col_num;
    4.30 -  }
    4.31 -  
    4.32 -  int LpSolverSkeleton::_addRow() 
    4.33 -  {
    4.34 -    return ++row_num;
    4.35 -  }
    4.36 -  
    4.37 -  void LpSolverSkeleton::_setRowCoeffs(int i, 
    4.38 -					       int length,
    4.39 -					       int  const * indices, 
    4.40 -					       Value  const * values )
    4.41 -  {
    4.42 -  }
    4.43 -  
    4.44 -  void LpSolverSkeleton::_setColCoeffs(int i, 
    4.45 -					       int length,
    4.46 -					       int  const * indices, 
    4.47 -					       Value  const * values)
    4.48 -  {
    4.49 -  }
    4.50 -  
    4.51 -  void LpSolverSkeleton::_setColLowerBound(int i, Value value)
    4.52 -  {
    4.53 -  }
    4.54 -  
    4.55 -  void LpSolverSkeleton::_setColUpperBound(int i, Value value)
    4.56 -  {
    4.57 -  }
    4.58 -  
    4.59 -  void LpSolverSkeleton::_setRowLowerBound(int i, Value value)
    4.60 -  {
    4.61 -  }
    4.62 -  
    4.63 -  void LpSolverSkeleton::_setRowUpperBound(int i, Value value)
    4.64 -  {
    4.65 -  }
    4.66 -  
    4.67 -  void LpSolverSkeleton::_setObjCoeff(int i, Value obj_coef)
    4.68 -  {
    4.69 -  }
    4.70 -
    4.71 -  void LpSolverSkeleton::_setMax()
    4.72 -  {
    4.73 -  }
    4.74 -  void LpSolverSkeleton::_setMin()
    4.75 -  {
    4.76 -  }
    4.77 -
    4.78 -  LpSolverSkeleton::SolveExitStatus LpSolverSkeleton::_solve()
    4.79 -  {
    4.80 -    return SOLVED;
    4.81 -  }
    4.82 -
    4.83 -  LpSolverSkeleton::Value LpSolverSkeleton::_getPrimal(int i)
    4.84 -  {
    4.85 -    return 0;
    4.86 -  }
    4.87 -  
    4.88 -  LpSolverSkeleton::Value LpSolverSkeleton::_getPrimalValue()
    4.89 -  {
    4.90 -    return 0;
    4.91 -  }
    4.92 -  
    4.93 -  LpSolverSkeleton::SolutionStatus LpSolverSkeleton::_getPrimalStatus()
    4.94 -  {
    4.95 -    return OPTIMAL;
    4.96 -  }
    4.97 -  
    4.98 -} //namespace lemon
    4.99 -
     5.1 --- a/src/lemon/lp_solver_skeleton.h	Thu Apr 07 06:31:03 2005 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,115 +0,0 @@
     5.4 -/* -*- C++ -*-
     5.5 - * src/lemon/lp_solver_skeleton.h
     5.6 - * - Part of LEMON, a generic C++ optimization library
     5.7 - *
     5.8 - * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     5.9 - * (Egervary Combinatorial Optimization Research Group, EGRES).
    5.10 - *
    5.11 - * Permission to use, modify and distribute this software is granted
    5.12 - * provided that this copyright notice appears in all copies. For
    5.13 - * precise terms see the accompanying LICENSE file.
    5.14 - *
    5.15 - * This software is provided "AS IS" with no warranty of any kind,
    5.16 - * express or implied, and with no claim as to its suitability for any
    5.17 - * purpose.
    5.18 - *
    5.19 - */
    5.20 -
    5.21 -#ifndef LEMON_LP_SOLVER_SKELETON
    5.22 -#define LEMON_LP_SOLVER_SKELETON
    5.23 -
    5.24 -#include"lp_base.h"
    5.25 -
    5.26 -///\file
    5.27 -///\brief A skeleton file to implement LP solver interfaces
    5.28 -namespace lemon {
    5.29 -  
    5.30 -  ///A skeleton class to implement LP solver interfaces
    5.31 -  class LpSolverSkeleton :public LpSolverBase {
    5.32 -    int col_num,row_num;
    5.33 -    
    5.34 -  protected:
    5.35 -    /// \e
    5.36 -    virtual int _addCol();
    5.37 -    /// \e
    5.38 -    virtual int _addRow();
    5.39 -    /// \e
    5.40 -
    5.41 -    /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
    5.42 -    ///
    5.43 -    virtual void _setRowCoeffs(int i, 
    5.44 -			       int length,
    5.45 -                               int  const * indices, 
    5.46 -                               Value  const * values );
    5.47 -    /// \e
    5.48 -
    5.49 -    /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
    5.50 -    ///
    5.51 -    virtual void _setColCoeffs(int i, 
    5.52 -			       int length,
    5.53 -                               int  const * indices, 
    5.54 -                               Value  const * values );
    5.55 -    
    5.56 -    /// \e
    5.57 -
    5.58 -    /// The lower bound of a variable (column) have to be given by an 
    5.59 -    /// extended number of type Value, i.e. a finite number of type 
    5.60 -    /// Value or -\ref INF.
    5.61 -    virtual void _setColLowerBound(int i, Value value);
    5.62 -    /// \e
    5.63 -
    5.64 -    /// The upper bound of a variable (column) have to be given by an 
    5.65 -    /// extended number of type Value, i.e. a finite number of type 
    5.66 -    /// Value or \ref INF.
    5.67 -    virtual void _setColUpperBound(int i, Value value);
    5.68 -    /// \e
    5.69 -
    5.70 -    /// The lower bound of a linear expression (row) have to be given by an 
    5.71 -    /// extended number of type Value, i.e. a finite number of type 
    5.72 -    /// Value or -\ref INF.
    5.73 -    virtual void _setRowLowerBound(int i, Value value);
    5.74 -    /// \e
    5.75 -
    5.76 -    /// The upper bound of a linear expression (row) have to be given by an 
    5.77 -    /// extended number of type Value, i.e. a finite number of type 
    5.78 -    /// Value or \ref INF.
    5.79 -    virtual void _setRowUpperBound(int i, Value value);
    5.80 -
    5.81 -    /// \e
    5.82 -    virtual void _setObjCoeff(int i, Value obj_coef);
    5.83 -
    5.84 -    ///\e
    5.85 -    
    5.86 -    ///\bug Wrong interface
    5.87 -    ///
    5.88 -    virtual SolveExitStatus _solve();
    5.89 -
    5.90 -    ///\e
    5.91 -
    5.92 -    ///\bug Wrong interface
    5.93 -    ///
    5.94 -    virtual Value _getPrimal(int i);
    5.95 -    ///\e
    5.96 -
    5.97 -    ///\bug Wrong interface
    5.98 -    ///
    5.99 -    virtual Value _getPrimalValue();
   5.100 -    ///\e
   5.101 -
   5.102 -    ///\bug Wrong interface
   5.103 -    ///
   5.104 -    virtual SolutionStatus _getPrimalStatus();
   5.105 -
   5.106 -    ///\e
   5.107 -    virtual void _setMax();
   5.108 -    ///\e
   5.109 -    virtual void _setMin();
   5.110 -    
   5.111 -
   5.112 -  public:
   5.113 -    LpSolverSkeleton() : LpSolverBase(), col_num(0), row_num(0) {}
   5.114 -  };  
   5.115 -
   5.116 -} //namespace lemon
   5.117 -
   5.118 -#endif // LEMON_LP_SOLVER_SKELETON
     6.1 --- a/src/test/lp_test.cc	Thu Apr 07 06:31:03 2005 +0000
     6.2 +++ b/src/test/lp_test.cc	Thu Apr 07 06:38:56 2005 +0000
     6.3 @@ -1,4 +1,4 @@
     6.4 -#include<lemon/lp_solver_skeleton.h>
     6.5 +#include<lemon/lp_skeleton.h>
     6.6  #include<lemon/lp_glpk.h>
     6.7  
     6.8  using namespace lemon;
     6.9 @@ -129,7 +129,7 @@
    6.10  
    6.11  int main() 
    6.12  {
    6.13 -  LpSolverSkeleton lp_skel;
    6.14 +  LpSkeleton lp_skel;
    6.15    LpGlpk lp_glpk;
    6.16  
    6.17    lpTest(lp_skel);