ClpConstraint.hpp
Go to the documentation of this file.
1 /* $Id: ClpConstraint.hpp 1525 2010-02-26 17:27:59Z mjs $ */
2 // Copyright (C) 2007, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 #ifndef ClpConstraint_H
5 #define ClpConstraint_H
6 
7 
8 //#############################################################################
9 class ClpSimplex;
10 class ClpModel;
11 
18 
19 public:
20 
22 
23 
30  virtual int gradient(const ClpSimplex * model,
31  const double * solution,
32  double * gradient,
33  double & functionValue ,
34  double & offset,
35  bool useScaling = false,
36  bool refresh = true) const = 0;
38  virtual double functionValue (const ClpSimplex * model,
39  const double * solution,
40  bool useScaling = false,
41  bool refresh = true) const ;
43  virtual void resize(int newNumberColumns) = 0;
45  virtual void deleteSome(int numberToDelete, const int * which) = 0;
47  virtual void reallyScale(const double * columnScale) = 0;
51  virtual int markNonlinear(char * which) const = 0;
55  virtual int markNonzero(char * which) const = 0;
57 
58 
60 
61  ClpConstraint();
63 
66 
69 
71  virtual ~ClpConstraint ();
72 
74  virtual ClpConstraint * clone() const = 0;
75 
77 
79 
80  inline int type() {
82  return type_;
83  }
85  inline int rowNumber() const {
86  return rowNumber_;
87  }
88 
90  virtual int numberCoefficients() const = 0;
91 
93  inline double functionValue () const {
94  return functionValue_;
95  }
96 
98  inline double offset () const {
99  return offset_;
100  }
102  virtual void newXValues() {}
104 
105  //---------------------------------------------------------------------------
106 
107 protected:
109 
110  mutable double * lastGradient_;
113  mutable double functionValue_;
115  mutable double offset_;
117  int type_;
121 };
122 
123 #endif