Clp  1.17.8
ClpQuadraticObjective.hpp
Go to the documentation of this file.
1 /* $Id$ */
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:
22 
23 
30  virtual double *gradient(const ClpSimplex *model,
31  const double *solution, double &offset, bool refresh,
32  int includeLinear = 2);
34 
36  virtual double reducedGradient(ClpSimplex *model, double *region,
37  bool useFeasibleCosts);
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);
52  virtual double objectiveValue(const ClpSimplex *model, const double *solution) const;
53  virtual void resize(int newNumberColumns);
55  virtual void deleteSome(int numberToDelete, const int *which);
57  virtual void reallyScale(const double *columnScale);
61  virtual int markNonlinear(char *which);
62 
64 
66 
69 
72  const CoinBigIndex *start,
73  const int *column, const double *element,
74  int numberExtendedColumns_ = -1);
75 
85  const int *whichColumns);
86 
89 
91  virtual ~ClpQuadraticObjective();
92 
94  virtual ClpObjective *clone() const;
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  {
115  return quadraticObjective_;
116  }
118  inline double *linearObjective() const
119  {
120  return objective_;
121  }
123  inline int numberExtendedColumns() const
124  {
125  return numberExtendedColumns_;
126  }
128  inline int numberColumns() const
129  {
130  return numberColumns_;
131  }
133  inline bool fullMatrix() const
134  {
135  return fullMatrix_;
136  }
138 
139  //---------------------------------------------------------------------------
140 
141 private:
144  CoinPackedMatrix *quadraticObjective_;
146  double *objective_;
148  double *gradient_;
156 };
157 
158 #endif
159 
160 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
161 */
ClpSimplex
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:106
ClpQuadraticObjective::quadraticObjective
CoinPackedMatrix * quadraticObjective() const
Quadratic objective.
Definition: ClpQuadraticObjective.hpp:113
ClpQuadraticObjective::clone
virtual ClpObjective * clone() const
Clone.
ClpObjective
Objective Abstract Base Class.
Definition: ClpObjective.hpp:18
ClpQuadraticObjective::resize
virtual void resize(int newNumberColumns)
Resize objective.
ClpQuadraticObjective::fullMatrix_
bool fullMatrix_
True if full symmetric matrix, false if half.
Definition: ClpQuadraticObjective.hpp:154
ClpQuadraticObjective::~ClpQuadraticObjective
virtual ~ClpQuadraticObjective()
Destructor.
ClpQuadraticObjective::subsetClone
virtual ClpObjective * subsetClone(int numberColumns, const int *whichColumns) const
Subset clone.
ClpQuadraticObjective::deleteSome
virtual void deleteSome(int numberToDelete, const int *which)
Delete columns in objective.
ClpQuadraticObjective::numberExtendedColumns
int numberExtendedColumns() const
Length of linear objective which could be bigger.
Definition: ClpQuadraticObjective.hpp:123
ClpQuadraticObjective::markNonlinear
virtual int markNonlinear(char *which)
Given a zeroed array sets nonlinear columns to 1.
ClpQuadraticObjective::loadQuadraticObjective
void loadQuadraticObjective(const int numberColumns, const CoinBigIndex *start, const int *column, const double *element, int numberExtendedColumns=-1)
Load up quadratic objective.
ClpQuadraticObjective::reallyScale
virtual void reallyScale(const double *columnScale)
Scale objective.
ClpQuadraticObjective::linearObjective
double * linearObjective() const
Linear objective.
Definition: ClpQuadraticObjective.hpp:118
ClpQuadraticObjective::numberColumns_
int numberColumns_
Useful to have number of columns about.
Definition: ClpQuadraticObjective.hpp:150
ClpQuadraticObjective::ClpQuadraticObjective
ClpQuadraticObjective()
Default Constructor.
ClpQuadraticObjective::operator=
ClpQuadraticObjective & operator=(const ClpQuadraticObjective &rhs)
Assignment operator.
ClpQuadraticObjective::stepLength
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...
ClpQuadraticObjective::reducedGradient
virtual double reducedGradient(ClpSimplex *model, double *region, bool useFeasibleCosts)
Resize objective.
ClpQuadraticObjective::quadraticObjective_
CoinPackedMatrix * quadraticObjective_
Definition: ClpQuadraticObjective.hpp:144
ClpQuadraticObjective::fullMatrix
bool fullMatrix() const
If a full or half matrix.
Definition: ClpQuadraticObjective.hpp:133
ClpQuadraticObjective::objectiveValue
virtual double objectiveValue(const ClpSimplex *model, const double *solution) const
Return objective value (without any ClpModel offset) (model may be NULL)
ClpQuadraticObjective::deleteQuadraticObjective
void deleteQuadraticObjective()
Get rid of quadratic objective.
ClpObjective.hpp
ClpQuadraticObjective::numberColumns
int numberColumns() const
Number of columns in quadratic objective.
Definition: ClpQuadraticObjective.hpp:128
ClpQuadraticObjective::numberExtendedColumns_
int numberExtendedColumns_
Also length of linear objective which could be bigger.
Definition: ClpQuadraticObjective.hpp:152
ClpQuadraticObjective::objective_
double * objective_
Objective.
Definition: ClpQuadraticObjective.hpp:146
ClpQuadraticObjective
Quadratic Objective Class.
Definition: ClpQuadraticObjective.hpp:18
ClpObjective::type
int type() const
Returns type (above 63 is extra information)
Definition: ClpObjective.hpp:98
ClpQuadraticObjective::gradient_
double * gradient_
Gradient.
Definition: ClpQuadraticObjective.hpp:148
ClpQuadraticObjective::gradient
virtual double * gradient(const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)
Returns gradient.