Loading...
Searching...
No Matches
ClpQuadraticObjective.hpp
Go to the documentation of this file.
/* $Id$ */
// Copyright (C) 2003, International Business Machines
// Corporation and others. All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).
#ifndef ClpQuadraticObjective_H
#define ClpQuadraticObjective_H
#include "ClpObjective.hpp"
#include "CoinPackedMatrix.hpp"
//#############################################################################
class ClpQuadraticObjective : public ClpObjective {
public:
virtual double *gradient(const ClpSimplex *model,
const double *solution, double &offset, bool refresh,
int includeLinear = 2);
virtual double reducedGradient(ClpSimplex *model, double *region,
bool useFeasibleCosts);
virtual double stepLength(ClpSimplex *model,
const double *solution,
const double *change,
double maximumTheta,
double &currentObj,
double &predictedObj,
double &thetaObj);
virtual double objectiveValue(const ClpSimplex *model, const double *solution) const;
virtual void resize(int newNumberColumns);
virtual void deleteSome(int numberToDelete, const int *which);
virtual void reallyScale(const double *columnScale);
virtual int markNonlinear(char *which);
ClpQuadraticObjective();
ClpQuadraticObjective(const double *linearObjective, int numberColumns,
const CoinBigIndex *start,
const int *column, const double *element,
int numberExtendedColumns_ = -1);
ClpQuadraticObjective(const ClpQuadraticObjective &rhs, int type = 0);
ClpQuadraticObjective(const ClpQuadraticObjective &rhs, int numberColumns,
const int *whichColumns);
ClpQuadraticObjective &operator=(const ClpQuadraticObjective &rhs);
virtual ~ClpQuadraticObjective();
virtual ClpObjective *clone() const;
virtual ClpObjective *subsetClone(int numberColumns,
const int *whichColumns) const;
void loadQuadraticObjective(const int numberColumns,
const CoinBigIndex *start,
const int *column, const double *element,
int numberExtendedColumns = -1);
void loadQuadraticObjective(const CoinPackedMatrix &matrix);
void deleteQuadraticObjective();
inline CoinPackedMatrix *quadraticObjective() const
{
return quadraticObjective_;
}
inline double *linearObjective() const
{
return objective_;
}
inline int numberExtendedColumns() const
{
return numberExtendedColumns_;
}
inline int numberColumns() const
{
return numberColumns_;
}
inline bool fullMatrix() const
{
return fullMatrix_;
}
//---------------------------------------------------------------------------
private:
CoinPackedMatrix *quadraticObjective_;
double *objective_;
double *gradient_;
int numberColumns_;
int numberExtendedColumns_;
bool fullMatrix_;
};
#endif
/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
ClpObjective.hpp
ClpObjective::type
int type() const
Returns type (above 63 is extra information).
Definition ClpObjective.hpp:98
ClpObjective::ClpObjective
ClpObjective()
Default Constructor.
ClpQuadraticObjective::ClpQuadraticObjective
ClpQuadraticObjective(const double *linearObjective, int numberColumns, const CoinBigIndex *start, const int *column, const double *element, int numberExtendedColumns_=-1)
Constructor from objective.
ClpQuadraticObjective::ClpQuadraticObjective
ClpQuadraticObjective(const ClpQuadraticObjective &rhs, int type=0)
Copy constructor .
ClpQuadraticObjective::numberExtendedColumns_
int numberExtendedColumns_
Also length of linear objective which could be bigger.
Definition ClpQuadraticObjective.hpp:152
ClpQuadraticObjective::~ClpQuadraticObjective
virtual ~ClpQuadraticObjective()
Destructor.
ClpQuadraticObjective::gradient
virtual double * gradient(const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)
Returns gradient.
ClpQuadraticObjective::fullMatrix
bool fullMatrix() const
If a full or half matrix.
Definition ClpQuadraticObjective.hpp:133
ClpQuadraticObjective::numberColumns_
int numberColumns_
Useful to have number of columns about.
Definition ClpQuadraticObjective.hpp:150
ClpQuadraticObjective::quadraticObjective
CoinPackedMatrix * quadraticObjective() const
Quadratic objective.
Definition ClpQuadraticObjective.hpp:113
ClpQuadraticObjective::gradient_
double * gradient_
Gradient.
Definition ClpQuadraticObjective.hpp:148
ClpQuadraticObjective::loadQuadraticObjective
void loadQuadraticObjective(const CoinPackedMatrix &matrix)
ClpQuadraticObjective::clone
virtual ClpObjective * clone() const
Clone.
ClpQuadraticObjective::fullMatrix_
bool fullMatrix_
True if full symmetric matrix, false if half.
Definition ClpQuadraticObjective.hpp:154
ClpQuadraticObjective::ClpQuadraticObjective
ClpQuadraticObjective(const ClpQuadraticObjective &rhs, int numberColumns, const int *whichColumns)
Subset constructor.
ClpQuadraticObjective::quadraticObjective_
CoinPackedMatrix * quadraticObjective_
Definition ClpQuadraticObjective.hpp:144
ClpQuadraticObjective::objectiveValue
virtual double objectiveValue(const ClpSimplex *model, const double *solution) const
Return objective value (without any ClpModel offset) (model may be NULL).
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::numberColumns
int numberColumns() const
Number of columns in quadratic objective.
Definition ClpQuadraticObjective.hpp:128
ClpQuadraticObjective::deleteQuadraticObjective
void deleteQuadraticObjective()
Get rid of quadratic objective.
ClpQuadraticObjective::numberExtendedColumns
int numberExtendedColumns() const
Length of linear objective which could be bigger.
Definition ClpQuadraticObjective.hpp:123
ClpQuadraticObjective::objective_
double * objective_
Objective.
Definition ClpQuadraticObjective.hpp:146
ClpQuadraticObjective::resize
virtual void resize(int newNumberColumns)
Resize objective.
ClpQuadraticObjective::linearObjective
double * linearObjective() const
Linear objective.
Definition ClpQuadraticObjective.hpp:118
ClpQuadraticObjective::reallyScale
virtual void reallyScale(const double *columnScale)
Scale objective.
ClpQuadraticObjective::markNonlinear
virtual int markNonlinear(char *which)
Given a zeroed array sets nonlinear columns to 1.
ClpQuadraticObjective::deleteSome
virtual void deleteSome(int numberToDelete, const int *which)
Delete columns in objective.
ClpQuadraticObjective::ClpQuadraticObjective
ClpQuadraticObjective()
Default Constructor.
ClpQuadraticObjective::loadQuadraticObjective
void loadQuadraticObjective(const int numberColumns, const CoinBigIndex *start, const int *column, const double *element, int numberExtendedColumns=-1)
Load up quadratic objective.
ClpQuadraticObjective::subsetClone
virtual ClpObjective * subsetClone(int numberColumns, const int *whichColumns) const
Subset clone.
ClpQuadraticObjective::reducedGradient
virtual double reducedGradient(ClpSimplex *model, double *region, bool useFeasibleCosts)
Resize objective.
ClpSimplex
This solves LPs using the simplex method.
Definition ClpSimplex.hpp:106