Cbc  2.10.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ClpQuadraticObjective.hpp
Go to the documentation of this file.
1 /* $Id: ClpQuadraticObjective.hpp 2385 2019-01-06 19:43:06Z unxusr $ */
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 
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  {
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:
146  double *objective_;
148  double *gradient_;
156 };
157 
158 #endif
159 
160 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
161 */
virtual ClpObjective * clone() const
Clone.
virtual void resize(int newNumberColumns)
Resize objective.
virtual double * gradient(const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)
Returns gradient.
double * objective_
Objective.
Quadratic Objective Class.
virtual ClpObjective * subsetClone(int numberColumns, const int *whichColumns) const
Subset clone.
virtual double objectiveValue(const ClpSimplex *model, const double *solution) const
Return objective value (without any ClpModel offset) (model may be NULL)
virtual void reallyScale(const double *columnScale)
Scale objective.
void deleteQuadraticObjective()
Get rid of quadratic objective.
int numberColumns() const
Number of columns in quadratic objective.
Objective Abstract Base Class.
ClpQuadraticObjective & operator=(const ClpQuadraticObjective &rhs)
Assignment operator.
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 ~ClpQuadraticObjective()
Destructor.
int numberColumns_
Useful to have number of columns about.
int numberExtendedColumns() const
Length of linear objective which could be bigger.
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:106
int type() const
Returns type (above 63 is extra information)
void loadQuadraticObjective(const int numberColumns, const CoinBigIndex *start, const int *column, const double *element, int numberExtendedColumns=-1)
Load up quadratic objective.
Sparse Matrix Base Class.
bool fullMatrix() const
If a full or half matrix.
int CoinBigIndex
bool fullMatrix_
True if full symmetric matrix, false if half.
virtual double reducedGradient(ClpSimplex *model, double *region, bool useFeasibleCosts)
Resize objective.
ClpQuadraticObjective()
Default Constructor.
virtual int markNonlinear(char *which)
Given a zeroed array sets nonlinear columns to 1.
CoinPackedMatrix * quadraticObjective_
virtual void deleteSome(int numberToDelete, const int *which)
Delete columns in objective.
CoinPackedMatrix * quadraticObjective() const
Quadratic objective.
int numberExtendedColumns_
Also length of linear objective which could be bigger.
double * linearObjective() const
Linear objective.