ClpAmplObjective.hpp
Go to the documentation of this file.
1 /* $Id: ClpAmplObjective.hpp 1173 2009-06-04 09:44:10Z forrest $ */
2 // Copyright (C) 2007, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 #ifndef ClpAmplObjective_H
5 #define ClpAmplObjective_H
6 
7 #include "ClpObjective.hpp"
8 #include "CoinPackedMatrix.hpp"
9 
10 //#############################################################################
11 
16 class ClpAmplObjective : public ClpObjective {
17 
18 public:
19 
21 
22 
29  virtual double * gradient(const ClpSimplex * model,
30  const double * solution, double & offset, bool refresh,
31  int includeLinear = 2);
33 
35  virtual double reducedGradient(ClpSimplex * model, double * region,
36  bool useFeasibleCosts);
43  virtual double stepLength(ClpSimplex * model,
44  const double * solution,
45  const double * change,
46  double maximumTheta,
47  double & currentObj,
48  double & predictedObj,
49  double & thetaObj);
51  virtual double objectiveValue(const ClpSimplex * model, const double * solution) const ;
52  virtual void resize(int newNumberColumns) ;
54  virtual void deleteSome(int numberToDelete, const int * which) ;
56  virtual void reallyScale(const double * columnScale) ;
60  virtual int markNonlinear(char * which);
61 
63  virtual void newXValues() ;
65 
66 
68 
71 
73  ClpAmplObjective(void * amplInfo);
74 
78 
81 
83  virtual ~ClpAmplObjective ();
84 
86  virtual ClpObjective * clone() const;
87 
89 
91  double * linearObjective() const;
94 
95  //---------------------------------------------------------------------------
96 
97 private:
100  double offset_;
102  void * amplObjective_;
104  double * objective_;
106  double * gradient_;
108 };
109 
110 #endif
111 
virtual ClpObjective * clone() const
Clone.
void * amplObjective_
Ampl info.
virtual int markNonlinear(char *which)
Given a zeroed array sets nonlinear columns to 1.
ClpAmplObjective()
Default Constructor.
virtual void resize(int newNumberColumns)
Returns gradient.
virtual double * gradient(const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)
Returns gradient.
Ampl Objective Class.
double * linearObjective() const
Linear objective.
double * gradient_
Gradient.
ClpAmplObjective & operator=(const ClpAmplObjective &rhs)
Assignment operator.
double * objective_
Objective.
double offset_
Ampl info.
virtual void deleteSome(int numberToDelete, const int *which)
Delete columns in objective.
virtual void newXValues()
Say we have new primal solution - so may need to recompute.
virtual double objectiveValue(const ClpSimplex *model, const double *solution) const
Return objective value (without any ClpModel offset) (model may be NULL)
virtual double reducedGradient(ClpSimplex *model, double *region, bool useFeasibleCosts)
Resize objective.
virtual double stepLength(ClpSimplex *model, const double *solution, const double *change, double maximumTheta, double &currentObj, double &predictedObj, double &thetaObj)
Returns step length which gives minimum of objective for solution + theta * change vector up to maxim...
virtual void reallyScale(const double *columnScale)
Scale objective.
virtual ~ClpAmplObjective()
Destructor.