00001
00002
00003 #ifndef ClpConstraint_H
00004 #define ClpConstraint_H
00005
00006
00007
00008 class ClpSimplex;
00009 class ClpModel;
00010
00016 class ClpConstraint {
00017
00018 public:
00019
00021
00022
00029 virtual int gradient(const ClpSimplex * model,
00030 const double * solution,
00031 double * gradient,
00032 double & functionValue ,
00033 double & offset,
00034 bool useScaling=false,
00035 bool refresh=true) const =0;
00037 virtual double functionValue (const ClpSimplex * model,
00038 const double * solution,
00039 bool useScaling=false,
00040 bool refresh=true) const ;
00042 virtual void resize(int newNumberColumns) = 0;
00044 virtual void deleteSome(int numberToDelete, const int * which) = 0;
00046 virtual void reallyScale(const double * columnScale) =0;
00050 virtual int markNonlinear(char * which) const = 0;
00054 virtual int markNonzero(char * which) const = 0;
00056
00057
00059
00060
00061 ClpConstraint();
00062
00064 ClpConstraint(const ClpConstraint &);
00065
00067 ClpConstraint & operator=(const ClpConstraint& rhs);
00068
00070 virtual ~ClpConstraint ();
00071
00073 virtual ClpConstraint * clone() const = 0;
00074
00076
00078
00079
00080 inline int type()
00081 { return type_;}
00083 inline int rowNumber() const
00084 {return rowNumber_;}
00085
00087 virtual int numberCoefficients() const = 0;
00088
00090 inline double functionValue () const
00091 { return functionValue_;}
00092
00094 inline double offset () const
00095 { return offset_;}
00097 virtual void newXValues() {}
00099
00100
00101
00102 protected:
00104
00105
00106 mutable double * lastGradient_;
00108 mutable double functionValue_;
00110 mutable double offset_;
00112 int type_;
00114 int rowNumber_;
00116 };
00117
00118 #endif