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

- File List
- File Members

ClpConstraint.hpp
Go to the documentation of this file.
1 /* $Id: ClpConstraint.hpp 1665 2011-01-04 17:55:54Z lou $ */
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 ClpConstraint_H
7 #define ClpConstraint_H
8
9
10 //#############################################################################
11 class ClpSimplex;
12 class ClpModel;
13
19 class ClpConstraint {
20
21 public:
22
24
25
32 virtual int gradient(const ClpSimplex * model,
33 const double * solution,
34 double * gradient,
35 double & functionValue ,
36 double & offset,
37 bool useScaling = false,
38 bool refresh = true) const = 0;
40 virtual double functionValue (const ClpSimplex * model,
41 const double * solution,
42 bool useScaling = false,
43 bool refresh = true) const ;
45 virtual void resize(int newNumberColumns) = 0;
47 virtual void deleteSome(int numberToDelete, const int * which) = 0;
49 virtual void reallyScale(const double * columnScale) = 0;
53 virtual int markNonlinear(char * which) const = 0;
57 virtual int markNonzero(char * which) const = 0;
59
60
62
63 ClpConstraint();
65
67 ClpConstraint(const ClpConstraint &);
68
70 ClpConstraint & operator=(const ClpConstraint& rhs);
71
73 virtual ~ClpConstraint ();
74
76 virtual ClpConstraint * clone() const = 0;
77
79
81
82 inline int type() {
84 return type_;
85 }
87 inline int rowNumber() const {
88 return rowNumber_;
89 }
90
92 virtual int numberCoefficients() const = 0;
93
95 inline double functionValue () const {
96 return functionValue_;
97 }
98
100 inline double offset () const {
101 return offset_;
102 }
104 virtual void newXValues() {}
106
107 //---------------------------------------------------------------------------
108
109 protected:
111
112 mutable double * lastGradient_;
115 mutable double functionValue_;
117 mutable double offset_;
119 int type_;
121 int rowNumber_;
123 };
124
125 #endif
ClpConstraint::lastGradient_
double * lastGradient_
Gradient at last evaluation.
Definition: ClpConstraint.hpp:113
ClpConstraint::offset_
double offset_
Value of offset for constraint.
Definition: ClpConstraint.hpp:117
ClpConstraint::gradient
virtual int gradient(const ClpSimplex *model, const double *solution, double *gradient, double &functionValue, double &offset, bool useScaling=false, bool refresh=true) const =0
Fills gradient.
ClpConstraint::ClpConstraint
ClpConstraint()
Default Constructor.
ClpConstraint::type_
int type_
Type of constraint - linear is 1.
Definition: ClpConstraint.hpp:119
ClpConstraint
Constraint Abstract Base Class.
Definition: ClpConstraint.hpp:19
ClpConstraint::reallyScale
virtual void reallyScale(const double *columnScale)=0
Scale constraint.
ClpConstraint::resize
virtual void resize(int newNumberColumns)=0
Resize constraint.
ClpConstraint::~ClpConstraint
virtual ~ClpConstraint()
Destructor.
ClpConstraint::rowNumber_
int rowNumber_
Row number (-1 is objective)
Definition: ClpConstraint.hpp:121
ClpConstraint::numberCoefficients
virtual int numberCoefficients() const =0
Number of possible coefficients in gradient.
ClpConstraint::deleteSome
virtual void deleteSome(int numberToDelete, const int *which)=0
Delete columns in constraint.
ClpConstraint::markNonlinear
virtual int markNonlinear(char *which) const =0
Given a zeroed array sets nonlinear columns to 1.
ClpConstraint::markNonzero
virtual int markNonzero(char *which) const =0
Given a zeroed array sets possible nonzero coefficients to 1.
ClpModel
Definition: ClpModel.hpp:38
ClpConstraint::operator=
ClpConstraint & operator=(const ClpConstraint &rhs)
Assignment operator.
ClpConstraint::rowNumber
int rowNumber() const
Row number (-1 is objective)
Definition: ClpConstraint.hpp:87
ClpSimplex
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:70
ClpConstraint::offset
double offset() const
Constraint offset.
Definition: ClpConstraint.hpp:100
ClpConstraint::type
int type()
Returns type, 0 linear, 1 nonlinear.
Definition: ClpConstraint.hpp:83
ClpConstraint::functionValue
double functionValue() const
Stored constraint function value.
Definition: ClpConstraint.hpp:95
ClpConstraint::clone
virtual ClpConstraint * clone() const =0
Clone.
ClpConstraint::functionValue_
double functionValue_
Value of non-linear part of constraint.
Definition: ClpConstraint.hpp:115
ClpConstraint::newXValues
virtual void newXValues()
Say we have new primal solution - so may need to recompute.
Definition: ClpConstraint.hpp:104