ClpConstraintLinear.hpp
Go to the documentation of this file.
1 /* $Id: ClpConstraintLinear.hpp 1525 2010-02-26 17:27:59Z mjs $ */
2 // Copyright (C) 2007, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 #ifndef ClpConstraintLinear_H
5 #define ClpConstraintLinear_H
6 
7 #include "ClpConstraint.hpp"
8 
9 //#############################################################################
10 
16 
17 public:
18 
20 
21 
22 
29  virtual int gradient(const ClpSimplex * model,
30  const double * solution,
31  double * gradient,
32  double & functionValue ,
33  double & offset,
34  bool useScaling = false,
35  bool refresh = true) const ;
37  virtual void resize(int newNumberColumns) ;
39  virtual void deleteSome(int numberToDelete, const int * which) ;
41  virtual void reallyScale(const double * columnScale) ;
45  virtual int markNonlinear(char * which) const ;
49  virtual int markNonzero(char * which) const;
51 
52 
54 
57 
60  const int * column, const double * element);
61 
65 
68 
70  virtual ~ClpConstraintLinear ();
71 
73  virtual ClpConstraint * clone() const;
75 
77  virtual int numberCoefficients() const;
80  inline int numberColumns() const {
81  return numberColumns_;
82  }
84  inline const int * column() const {
85  return column_;
86  }
88  inline const double * coefficient() const {
89  return coefficient_;
90  }
92 
93  //---------------------------------------------------------------------------
94 
95 private:
98  int * column_;
100  double * coefficient_;
106 };
107 
108 #endif
virtual void resize(int newNumberColumns)
Resize constraint.
ClpConstraintLinear & operator=(const ClpConstraintLinear &rhs)
Assignment operator.
virtual int gradient(const ClpSimplex *model, const double *solution, double *gradient, double &functionValue, double &offset, bool useScaling=false, bool refresh=true) const
Fills gradient.
Constraint Abstract Base Class.
double * coefficient_
Coefficients.
int * column_
Coefficients.
const double * coefficient() const
Coefficients.
virtual void reallyScale(const double *columnScale)
Scale constraint.
virtual int numberCoefficients() const
Number of coefficients.
virtual void deleteSome(int numberToDelete, const int *which)
Delete columns in constraint.
const int * column() const
Columns.
virtual int markNonzero(char *which) const
Given a zeroed array sets possible nonzero coefficients to 1.
int numberCoefficients_
Number of coefficients.
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:49
virtual ClpConstraint * clone() const
Clone.
virtual int markNonlinear(char *which) const
Given a zeroed array sets nonlinear columns to 1.
virtual ~ClpConstraintLinear()
Destructor.
double offset() const
Constraint offset.
Linear Constraint Class.
double functionValue() const
Stored constraint function value.
ClpConstraintLinear()
Default Constructor.
int numberColumns_
Useful to have number of columns about.
int numberColumns() const
Number of columns in linear constraint.