Loading...
Searching...
No Matches
ClpObjective.hpp
Go to the documentation of this file.
/* $Id$ */
// Copyright (C) 2002, International Business Machines
// Corporation and others. All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).
#ifndef ClpObjective_H
#define ClpObjective_H
//#############################################################################
class ClpSimplex;
class ClpModel;
class ClpObjective {
public:
virtual double *gradient(const ClpSimplex *model,
const double *solution,
double &offset, bool refresh,
int includeLinear = 2)
= 0;
virtual double reducedGradient(ClpSimplex *model, double *region,
bool useFeasibleCosts)
= 0;
virtual double stepLength(ClpSimplex *model,
const double *solution,
const double *change,
double maximumTheta,
double &currentObj,
double &predictedObj,
double &thetaObj)
= 0;
virtual double objectiveValue(const ClpSimplex *model, const double *solution) const = 0;
virtual void resize(int newNumberColumns) = 0;
virtual void deleteSome(int numberToDelete, const int *which) = 0;
virtual void reallyScale(const double *columnScale) = 0;
virtual int markNonlinear(char *which);
virtual void newXValues() {}
ClpObjective();
ClpObjective(const ClpObjective &);
ClpObjective &operator=(const ClpObjective &rhs);
virtual ~ClpObjective();
virtual ClpObjective *clone() const = 0;
virtual ClpObjective *subsetClone(int numberColumns,
const int *whichColumns) const;
inline int type() const
{
return type_;
}
inline void setType(int value)
{
type_ = value;
}
inline int activated() const
{
return activated_;
}
inline void setActivated(int value)
{
activated_ = value;
}
inline double nonlinearOffset() const
{
return offset_;
}
//---------------------------------------------------------------------------
protected:
double offset_;
int type_;
int activated_;
};
#endif
/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
ClpModel
Definition ClpModel.hpp:38
ClpObjective::setActivated
void setActivated(int value)
Set whether activated.
Definition ClpObjective.hpp:113
ClpObjective::offset_
double offset_
Value of non-linear part of objective.
Definition ClpObjective.hpp:131
ClpObjective::deleteSome
virtual void deleteSome(int numberToDelete, const int *which)=0
Delete columns in objective.
ClpObjective::newXValues
virtual void newXValues()
Say we have new primal solution - so may need to recompute.
Definition ClpObjective.hpp:67
ClpObjective::activated_
int activated_
Whether activated.
Definition ClpObjective.hpp:135
ClpObjective::nonlinearOffset
double nonlinearOffset() const
Objective offset.
Definition ClpObjective.hpp:119
ClpObjective::type
int type() const
Returns type (above 63 is extra information).
Definition ClpObjective.hpp:98
ClpObjective::~ClpObjective
virtual ~ClpObjective()
Destructor.
ClpObjective::operator=
ClpObjective & operator=(const ClpObjective &rhs)
Assignment operator.
ClpObjective::ClpObjective
ClpObjective(const ClpObjective &)
Copy constructor.
ClpObjective::stepLength
virtual double stepLength(ClpSimplex *model, const double *solution, const double *change, double maximumTheta, double &currentObj, double &predictedObj, double &thetaObj)=0
Returns step length which gives minimum of objective for solution + theta * change vector up to maxim...
ClpObjective::reducedGradient
virtual double reducedGradient(ClpSimplex *model, double *region, bool useFeasibleCosts)=0
Returns reduced gradient.Returns an offset (to be added to current one).
ClpObjective::ClpObjective
ClpObjective()
Default Constructor.
ClpObjective::gradient
virtual double * gradient(const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)=0
Returns gradient.
ClpObjective::reallyScale
virtual void reallyScale(const double *columnScale)=0
Scale objective.
ClpObjective::clone
virtual ClpObjective * clone() const =0
Clone.
ClpObjective::objectiveValue
virtual double objectiveValue(const ClpSimplex *model, const double *solution) const =0
Return objective value (without any ClpModel offset) (model may be NULL).
ClpObjective::markNonlinear
virtual int markNonlinear(char *which)
Given a zeroed array sets nonlinear columns to 1.
ClpObjective::resize
virtual void resize(int newNumberColumns)=0
Resize objective.
ClpObjective::activated
int activated() const
Whether activated.
Definition ClpObjective.hpp:108
ClpObjective::subsetClone
virtual ClpObjective * subsetClone(int numberColumns, const int *whichColumns) const
Subset clone.
ClpObjective::type_
int type_
Type of objective - linear is 1.
Definition ClpObjective.hpp:133
ClpObjective::setType
void setType(int value)
Sets type (above 63 is extra information).
Definition ClpObjective.hpp:103
ClpSimplex
This solves LPs using the simplex method.
Definition ClpSimplex.hpp:106