- lp_solver_skeleton.h/cc: skeleton for actual lp implenetations
authoralpar
Thu, 24 Mar 2005 12:15:50 +0000
changeset 1254c9558638fe42
parent 1253 609fe893df8c
child 1255 6455f64a85dc
- lp_solver_skeleton.h/cc: skeleton for actual lp implenetations
- lp_test.cc: test file
- updated Makefile
src/work/athos/lp/Makefile
src/work/athos/lp/lp_solver_skeleton.cc
src/work/athos/lp/lp_solver_skeleton.h
src/work/athos/lp/lp_test
src/work/athos/lp/lp_test.cc
     1.1 --- a/src/work/athos/lp/Makefile	Thu Mar 24 11:44:25 2005 +0000
     1.2 +++ b/src/work/athos/lp/Makefile	Thu Mar 24 12:15:50 2005 +0000
     1.3 @@ -1,3 +1,12 @@
     1.4 +CXXFLAGS = -Wall -ggdb --no-inline -I../../..
     1.5 +
     1.6 +all: lp_test
     1.7 +
     1.8  lp_base.o: lp_base.cc lp_base.h lin_expr.h
     1.9 +lp_solver_skeleton.o: lp_solver_skeleton.cc lp_solver_skeleton.h lp_base.h \
    1.10 +		lin_expr.h
    1.11 +lp_test.o: lp_test.cc lp_base.h lin_expr.h lp_solver_skeleton.h lp_base.h \
    1.12 +		lin_expr.h
    1.13  
    1.14 -	g++ -Wall -ggdb --no-inline -I../../.. -c $<
    1.15 \ No newline at end of file
    1.16 +lp_test: lp_test.o lp_base.o lp_solver_skeleton.o 
    1.17 +	g++ -o $@ $^
    1.18 \ No newline at end of file
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/work/athos/lp/lp_solver_skeleton.cc	Thu Mar 24 12:15:50 2005 +0000
     2.3 @@ -0,0 +1,69 @@
     2.4 +/* -*- C++ -*-
     2.5 + * src/lemon/lp_solver_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"lp_solver_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 LpSolverSkeleton::_addCol()
    2.28 +  {
    2.29 +    return 1;
    2.30 +  }
    2.31 +  
    2.32 +  int LpSolverSkeleton::_addRow() 
    2.33 +  {
    2.34 +    return 1;
    2.35 +  }
    2.36 +  
    2.37 +  void LpSolverSkeleton::_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 LpSolverSkeleton::_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 LpSolverSkeleton::_setColLowerBound(int i, Value value)
    2.52 +  {
    2.53 +  }
    2.54 +  
    2.55 +  void LpSolverSkeleton::_setColUpperBound(int i, Value value)
    2.56 +  {
    2.57 +  }
    2.58 +  
    2.59 +  void LpSolverSkeleton::_setRowLowerBound(int i, Value value)
    2.60 +  {
    2.61 +  }
    2.62 +  
    2.63 +  void LpSolverSkeleton::_setRowUpperBound(int i, Value value)
    2.64 +  {
    2.65 +  }
    2.66 +  
    2.67 +  void LpSolverSkeleton::_setObjCoeff(int i, Value obj_coef)
    2.68 +  {
    2.69 +  }
    2.70 +  
    2.71 +} //namespace lemon
    2.72 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/src/work/athos/lp/lp_solver_skeleton.h	Thu Mar 24 12:15:50 2005 +0000
     3.3 @@ -0,0 +1,50 @@
     3.4 +/* -*- C++ -*-
     3.5 + * src/lemon/lp_solver_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_SOLVER_SKELETON
    3.22 +#define LEMON_LP_SOLVER_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 LpSolverSkeleton :public LpSolverBase {
    3.32 +
    3.33 +  protected:
    3.34 +    virtual int _addCol();
    3.35 +    virtual int _addRow();
    3.36 +    virtual void _setRowCoeffs(int i, 
    3.37 +			       int length,
    3.38 +                               int  const * indices, 
    3.39 +                               Value  const * values );
    3.40 +    virtual void _setColCoeffs(int i, 
    3.41 +			       int length,
    3.42 +                               int  const * indices, 
    3.43 +                               Value  const * values);
    3.44 +    virtual void _setColLowerBound(int i, Value value);
    3.45 +    virtual void _setColUpperBound(int i, Value value);
    3.46 +    virtual void _setRowLowerBound(int i, Value value);
    3.47 +    virtual void _setRowUpperBound(int i, Value value);
    3.48 +    virtual void _setObjCoeff(int i, Value obj_coef);
    3.49 +  };  
    3.50 +
    3.51 +} //namespace lemon
    3.52 +
    3.53 +#endif // LEMON_LP_SOLVER_SKELETON
     4.1 Binary file src/work/athos/lp/lp_test has changed
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/src/work/athos/lp/lp_test.cc	Thu Mar 24 12:15:50 2005 +0000
     5.3 @@ -0,0 +1,8 @@
     5.4 +#include"lp_solver_skeleton.h"
     5.5 +
     5.6 +using namespace lemon;
     5.7 +
     5.8 +int main()
     5.9 +{
    5.10 +  LpSolverSkeleton lp;
    5.11 +}