6#ifndef ClpQuadraticObjective_H
7#define ClpQuadraticObjective_H
10#include "CoinPackedMatrix.hpp"
31 const double *solution,
double &offset,
bool refresh,
32 int includeLinear = 2);
37 bool useFeasibleCosts);
45 const double *solution,
53 virtual void resize(
int newNumberColumns);
55 virtual void deleteSome(
int numberToDelete,
const int *which);
72 const CoinBigIndex *start,
73 const int *column,
const double *element,
85 const int *whichColumns);
99 const int *whichColumns)
const;
103 const CoinBigIndex *start,
104 const int *column,
const double *element,
Objective Abstract Base Class.
int type() const
Returns type (above 63 is extra information)
Quadratic Objective Class.
ClpQuadraticObjective(const double *linearObjective, int numberColumns, const CoinBigIndex *start, const int *column, const double *element, int numberExtendedColumns_=-1)
Constructor from objective.
ClpQuadraticObjective(const ClpQuadraticObjective &rhs, int type=0)
Copy constructor .
int numberExtendedColumns_
Also length of linear objective which could be bigger.
virtual ~ClpQuadraticObjective()
Destructor.
virtual double * gradient(const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)
Returns gradient.
bool fullMatrix() const
If a full or half matrix.
int numberColumns_
Useful to have number of columns about.
CoinPackedMatrix * quadraticObjective() const
Quadratic objective.
double * gradient_
Gradient.
void loadQuadraticObjective(const CoinPackedMatrix &matrix)
virtual ClpObjective * clone() const
Clone.
bool fullMatrix_
True if full symmetric matrix, false if half.
ClpQuadraticObjective(const ClpQuadraticObjective &rhs, int numberColumns, const int *whichColumns)
Subset constructor.
CoinPackedMatrix * quadraticObjective_
virtual double objectiveValue(const ClpSimplex *model, const double *solution) const
Return objective value (without any ClpModel offset) (model may be NULL)
ClpQuadraticObjective & operator=(const ClpQuadraticObjective &rhs)
Assignment operator.
virtual double stepLength(ClpSimplex *model, const double *solution, const double *change, double maximumTheta, double ¤tObj, double &predictedObj, double &thetaObj)
Returns step length which gives minimum of objective for solution + theta * change vector up to maxim...
int numberColumns() const
Number of columns in quadratic objective.
void deleteQuadraticObjective()
Get rid of quadratic objective.
int numberExtendedColumns() const
Length of linear objective which could be bigger.
double * objective_
Objective.
virtual void resize(int newNumberColumns)
Resize objective.
double * linearObjective() const
Linear objective.
virtual void reallyScale(const double *columnScale)
Scale objective.
virtual int markNonlinear(char *which)
Given a zeroed array sets nonlinear columns to 1.
virtual void deleteSome(int numberToDelete, const int *which)
Delete columns in objective.
ClpQuadraticObjective()
Default Constructor.
void loadQuadraticObjective(const int numberColumns, const CoinBigIndex *start, const int *column, const double *element, int numberExtendedColumns=-1)
Load up quadratic objective.
virtual ClpObjective * subsetClone(int numberColumns, const int *whichColumns) const
Subset clone.
virtual double reducedGradient(ClpSimplex *model, double *region, bool useFeasibleCosts)
Resize objective.
This solves LPs using the simplex method.