ClpQuadraticObjective.hpp
Go to the documentation of this file.
1 /* $Id: ClpQuadraticObjective.hpp 1665 2011-01-04 17:55:54Z lou $ */
2 // Copyright (C) 2003, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 #ifndef ClpQuadraticObjective_H
7 #define ClpQuadraticObjective_H
8 
9 #include "ClpObjective.hpp"
10 #include "CoinPackedMatrix.hpp"
11 
12 //#############################################################################
13 
19 
20 public:
21 
23 
24 
31  virtual double * gradient(const ClpSimplex * model,
32  const double * solution, double & offset, bool refresh,
33  int includeLinear = 2);
35 
37  virtual double reducedGradient(ClpSimplex * model, double * region,
38  bool useFeasibleCosts);
45  virtual double stepLength(ClpSimplex * model,
46  const double * solution,
47  const double * change,
48  double maximumTheta,
49  double & currentObj,
50  double & predictedObj,
51  double & thetaObj);
53  virtual double objectiveValue(const ClpSimplex * model, const double * solution) const ;
54  virtual void resize(int newNumberColumns) ;
56  virtual void deleteSome(int numberToDelete, const int * which) ;
58  virtual void reallyScale(const double * columnScale) ;
62  virtual int markNonlinear(char * which);
63 
65 
66 
68 
71 
74  const CoinBigIndex * start,
75  const int * column, const double * element,
76  int numberExtendedColumns_ = -1);
77 
82  ClpQuadraticObjective(const ClpQuadraticObjective & rhs, int type = 0);
86  ClpQuadraticObjective (const ClpQuadraticObjective &rhs, int numberColumns,
87  const int * whichColumns) ;
88 
91 
93  virtual ~ClpQuadraticObjective ();
94 
96  virtual ClpObjective * clone() const;
100  virtual ClpObjective * subsetClone (int numberColumns,
101  const int * whichColumns) const;
102 
104  void loadQuadraticObjective(const int numberColumns,
105  const CoinBigIndex * start,
106  const int * column, const double * element,
107  int numberExtendedColumns = -1);
108  void loadQuadraticObjective ( const CoinPackedMatrix& matrix);
112 
114  inline CoinPackedMatrix * quadraticObjective() const {
116  return quadraticObjective_;
117  }
119  inline double * linearObjective() const {
120  return objective_;
121  }
123  inline int numberExtendedColumns() const {
124  return numberExtendedColumns_;
125  }
127  inline int numberColumns() const {
128  return numberColumns_;
129  }
131  inline bool fullMatrix() const {
132  return fullMatrix_;
133  }
135 
136  //---------------------------------------------------------------------------
137 
138 private:
143  double * objective_;
145  double * gradient_;
153 };
154 
155 #endif
int CoinBigIndex
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.
Sparse Matrix Base Class.
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:70
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...
int type() const
Returns type (above 63 is extra information)
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.