Cgl 0.60.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
18 class ClpQuadraticObjective : public ClpObjective {
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
67 ClpQuadraticObjective();
69
71 ClpQuadraticObjective(const double *linearObjective, int numberColumns,
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
88 ClpQuadraticObjective &operator=(const ClpQuadraticObjective &rhs);
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);
108 void deleteQuadraticObjective();
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_;
150 int numberColumns_;
152 int numberExtendedColumns_;
154 bool fullMatrix_;
156 };
157
158 #endif
159
160 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
161 */
ClpQuadraticObjective::clone
virtual ClpObjective * clone() const
Clone.
ClpQuadraticObjective::resize
virtual void resize(int newNumberColumns)
Resize objective.
ClpQuadraticObjective::gradient
virtual double * gradient(const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)
Returns gradient.
ClpQuadraticObjective::objective_
double * objective_
Objective.
Definition: ClpQuadraticObjective.hpp:146
ClpQuadraticObjective
Quadratic Objective Class.
Definition: ClpQuadraticObjective.hpp:18
ClpQuadraticObjective::subsetClone
virtual ClpObjective * subsetClone(int numberColumns, const int *whichColumns) const
Subset clone.
ClpQuadraticObjective::objectiveValue
virtual double objectiveValue(const ClpSimplex *model, const double *solution) const
Return objective value (without any ClpModel offset) (model may be NULL)
ClpQuadraticObjective::reallyScale
virtual void reallyScale(const double *columnScale)
Scale objective.
ClpQuadraticObjective::deleteQuadraticObjective
void deleteQuadraticObjective()
Get rid of quadratic objective.
ClpQuadraticObjective::numberColumns
int numberColumns() const
Number of columns in quadratic objective.
Definition: ClpQuadraticObjective.hpp:128
ClpObjective
Objective Abstract Base Class.
Definition: ClpObjective.hpp:18
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::~ClpQuadraticObjective
virtual ~ClpQuadraticObjective()
Destructor.
ClpQuadraticObjective::numberColumns_
int numberColumns_
Useful to have number of columns about.
Definition: ClpQuadraticObjective.hpp:150
ClpQuadraticObjective::numberExtendedColumns
int numberExtendedColumns() const
Length of linear objective which could be bigger.
Definition: ClpQuadraticObjective.hpp:123
ClpSimplex
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:106
ClpObjective::type
int type() const
Returns type (above 63 is extra information)
Definition: ClpObjective.hpp:98
ClpQuadraticObjective::loadQuadraticObjective
void loadQuadraticObjective(const int numberColumns, const CoinBigIndex *start, const int *column, const double *element, int numberExtendedColumns=-1)
Load up quadratic objective.
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
ClpObjective.hpp
ClpQuadraticObjective::fullMatrix
bool fullMatrix() const
If a full or half matrix.
Definition: ClpQuadraticObjective.hpp:133
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:136
ClpQuadraticObjective::fullMatrix_
bool fullMatrix_
True if full symmetric matrix, false if half.
Definition: ClpQuadraticObjective.hpp:154
ClpQuadraticObjective::reducedGradient
virtual double reducedGradient(ClpSimplex *model, double *region, bool useFeasibleCosts)
Resize objective.
ClpQuadraticObjective::ClpQuadraticObjective
ClpQuadraticObjective()
Default Constructor.
ClpQuadraticObjective::markNonlinear
virtual int markNonlinear(char *which)
Given a zeroed array sets nonlinear columns to 1.
ClpQuadraticObjective::quadraticObjective_
CoinPackedMatrix * quadraticObjective_
Definition: ClpQuadraticObjective.hpp:144
ClpQuadraticObjective::gradient_
double * gradient_
Gradient.
Definition: ClpQuadraticObjective.hpp:148
ClpQuadraticObjective::deleteSome
virtual void deleteSome(int numberToDelete, const int *which)
Delete columns in objective.
ClpQuadraticObjective::quadraticObjective
CoinPackedMatrix * quadraticObjective() const
Quadratic objective.
Definition: ClpQuadraticObjective.hpp:113
ClpQuadraticObjective::numberExtendedColumns_
int numberExtendedColumns_
Also length of linear objective which could be bigger.
Definition: ClpQuadraticObjective.hpp:152
CoinPackedMatrix.hpp
ClpQuadraticObjective::linearObjective
double * linearObjective() const
Linear objective.
Definition: ClpQuadraticObjective.hpp:118