Cbc 2.10.12
Loading...
Searching...
No Matches
ClpAmplObjective.hpp
Go to the documentation of this file.
1/* $Id$ */
2// Copyright (C) 2007, 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 ClpAmplObjective_H
7#define ClpAmplObjective_H
8
9#include "ClpObjective.hpp"
10#include "CoinPackedMatrix.hpp"
11
12//#############################################################################
13
18class ClpAmplObjective : public ClpObjective {
19
20public:
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 virtual void newXValues();
66
68
69
71
73 ClpAmplObjective(void *amplInfo);
74
78
81
84
86 virtual ClpObjective *clone() const;
87
89
91
92 double *linearObjective() const;
94
95 //---------------------------------------------------------------------------
96
97private:
100 double offset_;
104 double *objective_;
106 double *gradient_;
108};
109
110#endif
111
112/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
113*/
Ampl Objective Class.
double * objective_
Objective.
ClpAmplObjective()
Default Constructor.
virtual void reallyScale(const double *columnScale)
Scale objective.
ClpAmplObjective(void *amplInfo)
Constructor from ampl info.
ClpAmplObjective & operator=(const ClpAmplObjective &rhs)
Assignment operator.
virtual double reducedGradient(ClpSimplex *model, double *region, bool useFeasibleCosts)
Resize objective.
virtual void newXValues()
Say we have new primal solution - so may need to recompute.
void * amplObjective_
Ampl info.
virtual double * gradient(const ClpSimplex *model, const double *solution, double &offset, bool refresh, int includeLinear=2)
Returns gradient.
virtual int markNonlinear(char *which)
Given a zeroed array sets nonlinear columns to 1.
virtual ClpObjective * clone() const
Clone.
virtual ~ClpAmplObjective()
Destructor.
double * linearObjective() const
Linear objective.
double * gradient_
Gradient.
ClpAmplObjective(const ClpAmplObjective &rhs)
Copy constructor .
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 void deleteSome(int numberToDelete, const int *which)
Delete columns in objective.
virtual double objectiveValue(const ClpSimplex *model, const double *solution) const
Return objective value (without any ClpModel offset) (model may be NULL)
virtual void resize(int newNumberColumns)