ClpQuadraticObjective.hpp
Go to the documentation of this file.
1 /* $Id: ClpQuadraticObjective.hpp 1525 2010-02-26 17:27:59Z mjs $ */
2 // Copyright (C) 2003, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 #ifndef ClpQuadraticObjective_H
5 #define ClpQuadraticObjective_H
6 
7 #include "ClpObjective.hpp"
8 #include "CoinPackedMatrix.hpp"
9 
10 //#############################################################################
11 
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 
64 
66 
69 
72  const CoinBigIndex * start,
73  const int * column, const double * element,
74  int numberExtendedColumns_ = -1);
75 
80  ClpQuadraticObjective(const ClpQuadraticObjective & rhs, int type = 0);
84  ClpQuadraticObjective (const ClpQuadraticObjective &rhs, int numberColumns,
85  const int * whichColumns) ;
86 
89 
91  virtual ~ClpQuadraticObjective ();
92 
94  virtual ClpObjective * clone() const;
98  virtual ClpObjective * subsetClone (int numberColumns,
99  const int * whichColumns) const;
100 
102  void loadQuadraticObjective(const int numberColumns,
103  const CoinBigIndex * start,
104  const int * column, const double * element,
105  int numberExtendedColumns = -1);
106  void loadQuadraticObjective ( const CoinPackedMatrix& matrix);
110 
112  inline CoinPackedMatrix * quadraticObjective() const {
114  return quadraticObjective_;
115  }
117  inline double * linearObjective() const {
118  return objective_;
119  }
121  inline int numberExtendedColumns() const {
122  return numberExtendedColumns_;
123  }
125  inline int numberColumns() const {
126  return numberColumns_;
127  }
129  inline bool fullMatrix() const {
130  return fullMatrix_;
131  }
133 
134  //---------------------------------------------------------------------------
135 
136 private:
139  CoinPackedMatrix * quadraticObjective_;
141  double * objective_;
143  double * gradient_;
151 };
152 
153 #endif
virtual void reallyScale(const double *columnScale)
Scale objective.
virtual void deleteSome(int numberToDelete, const int *which)
Delete columns in objective.
void deleteQuadraticObjective()
Get rid of quadratic objective.
double * objective_
Objective.
CoinPackedMatrix * quadraticObjective() const
Quadratic objective.
virtual double objectiveValue(const ClpSimplex *model, const double *solution) const
Return objective value (without any ClpModel offset) (model may be NULL)
Objective Abstract Base Class.
ClpQuadraticObjective & operator=(const ClpQuadraticObjective &rhs)
Assignment operator.
virtual void resize(int newNumberColumns)
Returns gradient.
virtual ~ClpQuadraticObjective()
Destructor.
Quadratic Objective Class.
double * linearObjective() const
Linear objective.
virtual int markNonlinear(char *which)
Given a zeroed array sets nonlinear columns to 1.
int numberColumns() const
Number of columns in quadratic objective.
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:49
int numberColumns_
Useful to have number of columns about.
virtual ClpObjective * clone() const
Clone.
ClpQuadraticObjective()
Default Constructor.
CoinPackedMatrix * quadraticObjective_
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 ClpObjective * subsetClone(int numberColumns, const int *whichColumns) const
Subset clone.
int numberExtendedColumns_
Also length of linear objective which could be bigger.
int numberExtendedColumns() const
Length of linear objective which could be bigger.
void loadQuadraticObjective(const int numberColumns, const CoinBigIndex *start, const int *column, const double *element, int numberExtendedColumns=-1)
Load up quadratic objective.
bool fullMatrix_
True if full symmetric matrix, false if half.
virtual double * gradient(const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)
Returns gradient.
virtual double reducedGradient(ClpSimplex *model, double *region, bool useFeasibleCosts)
Resize objective.
bool fullMatrix() const
If a full or half matrix.
int type()
Returns type (above 63 is extra information)