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_;}
00084 inline int rowNumber() const
00085 {return rowNumber_;}
00086
00088 virtual int numberCoefficients() const = 0;
00089
00091 inline double functionValue () const
00092 { return functionValue_;}
00093
00095 inline double offset () const
00096 { return offset_;}
00098 virtual void newXValues() {}
00100
00101
00102
00103 protected:
00105
00106
00107 mutable double * lastGradient_;
00109 mutable double functionValue_;
00111 mutable double offset_;
00113 int type_;
00115 int rowNumber_;
00117 };
00118
00119 #endif