Changeset 2385 for trunk/Clp/src/ClpObjective.hpp
 Timestamp:
 Jan 6, 2019 2:43:06 PM (4 months ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Clp/src/ClpObjective.hpp
r1825 r2385 6 6 #ifndef ClpObjective_H 7 7 #define ClpObjective_H 8 9 8 10 9 //############################################################################# … … 17 16 18 17 */ 19 class ClpObjective 18 class ClpObjective { 20 19 21 20 public: 21 ///@name Stuff 22 //@{ 22 23 23 ///@name Stuff 24 //@{ 25 26 /** Returns gradient. If Linear then solution may be NULL, 24 /** Returns gradient. If Linear then solution may be NULL, 27 25 also returns an offset (to be added to current one) 28 26 If refresh is false then uses last solution … … 30 28 includeLinear 0  no, 1 as is, 2 as feasible 31 29 */ 32 virtual double * gradient(const ClpSimplex * model, 33 const double * solution, 34 double & offset, bool refresh, 35 int includeLinear = 2) = 0; 36 /** Returns reduced gradient.Returns an offset (to be added to current one). 30 virtual double *gradient(const ClpSimplex *model, 31 const double *solution, 32 double &offset, bool refresh, 33 int includeLinear = 2) 34 = 0; 35 /** Returns reduced gradient.Returns an offset (to be added to current one). 37 36 */ 38 virtual double reducedGradient(ClpSimplex * model, double * region, 39 bool useFeasibleCosts) = 0; 40 /** Returns step length which gives minimum of objective for 37 virtual double reducedGradient(ClpSimplex *model, double *region, 38 bool useFeasibleCosts) 39 = 0; 40 /** Returns step length which gives minimum of objective for 41 41 solution + theta * change vector up to maximum theta. 42 42 … … 44 44 Also sets current objective, predicted and at maximumTheta 45 45 */ 46 virtual double stepLength(ClpSimplex * model, 47 const double * solution, 48 const double * change, 49 double maximumTheta, 50 double & currentObj, 51 double & predictedObj, 52 double & thetaObj) = 0; 53 /// Return objective value (without any ClpModel offset) (model may be NULL) 54 virtual double objectiveValue(const ClpSimplex * model, const double * solution) const = 0; 55 /// Resize objective 56 virtual void resize(int newNumberColumns) = 0; 57 /// Delete columns in objective 58 virtual void deleteSome(int numberToDelete, const int * which) = 0; 59 /// Scale objective 60 virtual void reallyScale(const double * columnScale) = 0; 61 /** Given a zeroed array sets nonlinear columns to 1. 46 virtual double stepLength(ClpSimplex *model, 47 const double *solution, 48 const double *change, 49 double maximumTheta, 50 double ¤tObj, 51 double &predictedObj, 52 double &thetaObj) 53 = 0; 54 /// Return objective value (without any ClpModel offset) (model may be NULL) 55 virtual double objectiveValue(const ClpSimplex *model, const double *solution) const = 0; 56 /// Resize objective 57 virtual void resize(int newNumberColumns) = 0; 58 /// Delete columns in objective 59 virtual void deleteSome(int numberToDelete, const int *which) = 0; 60 /// Scale objective 61 virtual void reallyScale(const double *columnScale) = 0; 62 /** Given a zeroed array sets nonlinear columns to 1. 62 63 Returns number of nonlinear columns 63 64 */ 64 virtual int markNonlinear(char *which);65 66 67 65 virtual int markNonlinear(char *which); 66 /// Say we have new primal solution  so may need to recompute 67 virtual void newXValues() {} 68 //@} 68 69 70 ///@name Constructors and destructors 71 //@{ 72 /// Default Constructor 73 ClpObjective(); 69 74 70 ///@name Constructors and destructors 71 //@{ 72 /// Default Constructor 73 ClpObjective(); 75 /// Copy constructor 76 ClpObjective(const ClpObjective &); 74 77 75 /// Copy constructor76 ClpObjective(const ClpObjective &);78 /// Assignment operator 79 ClpObjective &operator=(const ClpObjective &rhs); 77 80 78 /// Assignment operator79 ClpObjective & operator=(const ClpObjective& rhs);81 /// Destructor 82 virtual ~ClpObjective(); 80 83 81 /// Destructor 82 virtual ~ClpObjective (); 83 84 /// Clone 85 virtual ClpObjective * clone() const = 0; 86 /** Subset clone. Duplicates are allowed 84 /// Clone 85 virtual ClpObjective *clone() const = 0; 86 /** Subset clone. Duplicates are allowed 87 87 and order is as given. 88 88 Derived classes need not provide this as it may not always make 89 89 sense */ 90 virtual ClpObjective * subsetClone(int numberColumns,91 const int *whichColumns) const;90 virtual ClpObjective *subsetClone(int numberColumns, 91 const int *whichColumns) const; 92 92 93 93 //@} 94 94 95 ///@name Other 96 //@{ 97 /// Returns type (above 63 is extra information) 98 inline int type() const { 99 return type_; 100 } 101 /// Sets type (above 63 is extra information) 102 inline void setType(int value) { 103 type_ = value; 104 } 105 /// Whether activated 106 inline int activated() const { 107 return activated_; 108 } 109 /// Set whether activated 110 inline void setActivated(int value) { 111 activated_ = value; 112 } 95 ///@name Other 96 //@{ 97 /// Returns type (above 63 is extra information) 98 inline int type() const 99 { 100 return type_; 101 } 102 /// Sets type (above 63 is extra information) 103 inline void setType(int value) 104 { 105 type_ = value; 106 } 107 /// Whether activated 108 inline int activated() const 109 { 110 return activated_; 111 } 112 /// Set whether activated 113 inline void setActivated(int value) 114 { 115 activated_ = value; 116 } 113 117 114 /// Objective offset 115 inline double nonlinearOffset () const { 116 return offset_; 117 } 118 //@} 118 /// Objective offset 119 inline double nonlinearOffset() const 120 { 121 return offset_; 122 } 123 //@} 119 124 120 125 // 121 126 122 127 protected: 123 124 125 126 127 128 129 130 131 128 ///@name Protected member data 129 //@{ 130 /// Value of nonlinear part of objective 131 double offset_; 132 /// Type of objective  linear is 1 133 int type_; 134 /// Whether activated 135 int activated_; 136 //@} 132 137 }; 133 138 134 139 #endif 140 141 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2 142 */
Note: See TracChangeset
for help on using the changeset viewer.