Go to the documentation of this file.00001
00002
00003
00004 #ifndef ClpConstraint_H
00005 #define ClpConstraint_H
00006
00007
00008
00009 class ClpSimplex;
00010 class ClpModel;
00011
00017 class ClpConstraint {
00018
00019 public:
00020
00022
00023
00030 virtual int gradient(const ClpSimplex * model,
00031 const double * solution,
00032 double * gradient,
00033 double & functionValue ,
00034 double & offset,
00035 bool useScaling = false,
00036 bool refresh = true) const = 0;
00038 virtual double functionValue (const ClpSimplex * model,
00039 const double * solution,
00040 bool useScaling = false,
00041 bool refresh = true) const ;
00043 virtual void resize(int newNumberColumns) = 0;
00045 virtual void deleteSome(int numberToDelete, const int * which) = 0;
00047 virtual void reallyScale(const double * columnScale) = 0;
00051 virtual int markNonlinear(char * which) const = 0;
00055 virtual int markNonzero(char * which) const = 0;
00057
00058
00060
00061
00062 ClpConstraint();
00063
00065 ClpConstraint(const ClpConstraint &);
00066
00068 ClpConstraint & operator=(const ClpConstraint& rhs);
00069
00071 virtual ~ClpConstraint ();
00072
00074 virtual ClpConstraint * clone() const = 0;
00075
00077
00079
00080
00081 inline int type() {
00082 return type_;
00083 }
00085 inline int rowNumber() const {
00086 return rowNumber_;
00087 }
00088
00090 virtual int numberCoefficients() const = 0;
00091
00093 inline double functionValue () const {
00094 return functionValue_;
00095 }
00096
00098 inline double offset () const {
00099 return offset_;
00100 }
00102 virtual void newXValues() {}
00104
00105
00106
00107 protected:
00109
00110
00111 mutable double * lastGradient_;
00113 mutable double functionValue_;
00115 mutable double offset_;
00117 int type_;
00119 int rowNumber_;
00121 };
00122
00123 #endif