ClpObjective.hpp
Go to the documentation of this file.
1 /* $Id: ClpObjective.hpp 1525 2010-02-26 17:27:59Z mjs $ */
2 // Copyright (C) 2002, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 #ifndef ClpObjective_H
5 #define ClpObjective_H
6 
7 
8 //#############################################################################
9 class ClpSimplex;
10 class ClpModel;
11 
17 class ClpObjective {
18 
19 public:
20 
22 
23 
30  virtual double * gradient(const ClpSimplex * model,
31  const double * solution,
32  double & offset, bool refresh,
33  int includeLinear = 2) = 0;
36  virtual double reducedGradient(ClpSimplex * model, double * region,
37  bool useFeasibleCosts) = 0;
44  virtual double stepLength(ClpSimplex * model,
45  const double * solution,
46  const double * change,
47  double maximumTheta,
48  double & currentObj,
49  double & predictedObj,
50  double & thetaObj) = 0;
52  virtual double objectiveValue(const ClpSimplex * model, const double * solution) const = 0;
54  virtual void resize(int newNumberColumns) = 0;
56  virtual void deleteSome(int numberToDelete, const int * which) = 0;
58  virtual void reallyScale(const double * columnScale) = 0;
62  virtual int markNonlinear(char * which);
64  virtual void newXValues() {}
66 
67 
69 
70  ClpObjective();
72 
74  ClpObjective(const ClpObjective &);
75 
77  ClpObjective & operator=(const ClpObjective& rhs);
78 
80  virtual ~ClpObjective ();
81 
83  virtual ClpObjective * clone() const = 0;
88  virtual ClpObjective * subsetClone (int numberColumns,
89  const int * whichColumns) const;
90 
92 
94 
95  inline int type() {
97  return type_;
98  }
100  inline int activated() const {
101  return activated_;
102  }
104  inline void setActivated(int value) {
105  activated_ = value;
106  }
107 
109  inline double nonlinearOffset () const {
110  return offset_;
111  }
113 
114  //---------------------------------------------------------------------------
115 
116 protected:
118 
119  double offset_;
122  int type_;
126 };
127 
128 #endif