source/inc/numeric/lpmodel.hxx

Go to the documentation of this file.
00001 /*************************************************************************
00002  *
00003  *  The Contents of this file are made available subject to
00004  *  the terms of GNU Lesser General Public License Version 2.1.
00005  *
00006  *
00007  *    GNU Lesser General Public License Version 2.1
00008  *    =============================================
00009  *    Copyright 2005 by Kohei Yoshida.
00010  *    1039 Kingsway Dr., Apex, NC 27502, USA
00011  *
00012  *    This library is free software; you can redistribute it and/or
00013  *    modify it under the terms of the GNU Lesser General Public
00014  *    License version 2.1, as published by the Free Software Foundation.
00015  *
00016  *    This library is distributed in the hope that it will be useful,
00017  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  *    Lesser General Public License for more details.
00020  *
00021  *    You should have received a copy of the GNU Lesser General Public
00022  *    License along with this library; if not, write to the Free Software
00023  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00024  *    MA  02111-1307  USA
00025  *
00026  ************************************************************************/
00027 
00028 
00029 #ifndef _LPMODEL_HXX_
00030 #define _LPMODEL_HXX_
00031 
00032 #include <numeric/type.hxx>
00033 #include <vector>
00034 #include <memory>
00035 
00036 namespace scsolver { namespace numeric { 
00037 
00038 class Matrix;
00039 
00040 namespace lp {
00041 
00042 
00043 class BaseAlgorithm;
00044 class ModelImpl;
00045 
00046 
00050 class Model
00051 {
00052 public:
00053 
00054         Model();
00055         Model( const Model& );
00056         ~Model();
00057         
00058         void print() const;
00059 
00060         size_t getDecisionVarSize() const;
00061 
00068         size_t getConstraintCount() const;
00069 
00070         double getCost( size_t rowid ) const;
00071         ::scsolver::numeric::Matrix getCostVector() const;
00072         void setCostVectorElement( size_t, double );
00073         void setCostVector( const ::std::vector<double>& );
00074 
00075         double   getVarBound( size_t, BoundType ) const;
00076         void     setVarBound( size_t, BoundType, double );
00077         bool isVarBounded( size_t, BoundType ) const;
00078 
00079         void deleteVariables( const ::std::vector<size_t>& );
00080 
00081         GoalType getGoal() const;
00082         void setGoal( GoalType );
00083         
00084         double getObjectiveFuncConstant() const;
00085         void setObjectiveFuncConstant( double );
00086 
00087         unsigned long getPrecision() const;
00088         void       setPrecision( unsigned long );
00089 
00090         bool getVarPositive() const;
00091         void setVarPositive( bool );
00092 
00093         bool getVarInteger() const;
00094         void setVarInteger( bool b );
00095 
00096         bool getVerbose() const;
00097         void setVerbose( bool );
00098 
00099         double getConstraint( size_t, size_t ) const;
00100         ::scsolver::numeric::Matrix getConstraintMatrix() const;
00101         ::scsolver::numeric::Matrix getRhsVector() const;
00102         double getRhsValue( size_t ) const;
00103         void setRhsValue( size_t, double );
00104         ::std::vector< ::scsolver::numeric::EqualityType > getEqualityVector() const;
00105 	::scsolver::numeric::EqualityType getEquality( size_t ) const;
00106         void addConstraint( const ::std::vector<double>&, EqualityType, double );
00107         void setStandardConstraintMatrix( const ::scsolver::numeric::Matrix&, const ::scsolver::numeric::Matrix& );
00108 
00109 private:
00110 
00111         std::auto_ptr<ModelImpl> m_pImpl;
00112 };
00113 
00114 
00115 }}}
00116 
00117 
00118 #endif

Generated on Mon Jul 28 09:13:20 2008 for scsolver by  doxygen 1.5.3