00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
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