Clp 1.17.11
Loading...
Searching...
No Matches
ClpConstraintLinear Class Reference

Linear Constraint Class. More...

#include <ClpConstraintLinear.hpp>

Inheritance diagram for ClpConstraintLinear:
Collaboration diagram for ClpConstraintLinear:

Public Member Functions

Stuff
virtual int gradient (const ClpSimplex *model, const double *solution, double *gradient, double &functionValue, double &offset, bool useScaling=false, bool refresh=true) const
 Fills gradient.
virtual void resize (int newNumberColumns)
 Resize constraint.
virtual void deleteSome (int numberToDelete, const int *which)
 Delete columns in constraint.
virtual void reallyScale (const double *columnScale)
 Scale constraint.
virtual int markNonlinear (char *which) const
 Given a zeroed array sets nonlinear columns to 1.
virtual int markNonzero (char *which) const
 Given a zeroed array sets possible nonzero coefficients to 1.
Constructors and destructors
 ClpConstraintLinear ()
 Default Constructor.
 ClpConstraintLinear (int row, int numberCoefficients, int numberColumns, const int *column, const double *element)
 Constructor from constraint.
 ClpConstraintLinear (const ClpConstraintLinear &rhs)
 Copy constructor .
ClpConstraintLinear & operator= (const ClpConstraintLinear &rhs)
 Assignment operator.
virtual ~ClpConstraintLinear ()
 Destructor.
virtual ClpConstraint * clone () const
 Clone.
Gets and sets
virtual int numberCoefficients () const
 Number of coefficients.
int numberColumns () const
 Number of columns in linear constraint.
const int * column () const
 Columns.
const double * coefficient () const
 Coefficients.
Public Member Functions inherited from ClpConstraint
virtual double functionValue (const ClpSimplex *model, const double *solution, bool useScaling=false, bool refresh=true) const
 Constraint function value.
 ClpConstraint ()
 Default Constructor.
 ClpConstraint (const ClpConstraint &)
 Copy constructor.
ClpConstraint & operator= (const ClpConstraint &rhs)
 Assignment operator.
virtual ~ClpConstraint ()
 Destructor.
int type ()
 Returns type, 0 linear, 1 nonlinear.
int rowNumber () const
 Row number (-1 is objective).
double functionValue () const
 Stored constraint function value.
double offset () const
 Constraint offset.
virtual void newXValues ()
 Say we have new primal solution - so may need to recompute.

Private Attributes

Private member data

Column

int * column_
double * coefficient_
 Coefficients.
int numberColumns_
 Useful to have number of columns about.
int numberCoefficients_
 Number of coefficients.

Additional Inherited Members

Protected Attributes inherited from ClpConstraint
double * lastGradient_
 Gradient at last evaluation.
double functionValue_
 Value of non-linear part of constraint.
double offset_
 Value of offset for constraint.
int type_
 Type of constraint - linear is 1.
int rowNumber_
 Row number (-1 is objective).

Detailed Description

Linear Constraint Class.

Definition at line 17 of file ClpConstraintLinear.hpp.

Constructor & Destructor Documentation

◆ ClpConstraintLinear() [1/3]

ClpConstraintLinear::ClpConstraintLinear ( )

Default Constructor.

◆ ClpConstraintLinear() [2/3]

ClpConstraintLinear::ClpConstraintLinear ( int row,
int numberCoefficients,
int numberColumns,
const int * column,
const double * element )

Constructor from constraint.

◆ ClpConstraintLinear() [3/3]

ClpConstraintLinear::ClpConstraintLinear ( const ClpConstraintLinear & rhs)

Copy constructor .

◆ ~ClpConstraintLinear()

virtual ClpConstraintLinear::~ClpConstraintLinear ( )
virtual

Destructor.

Member Function Documentation

◆ gradient()

virtual int ClpConstraintLinear::gradient ( const ClpSimplex * model,
const double * solution,
double * gradient,
double & functionValue,
double & offset,
bool useScaling = false,
bool refresh = true ) const
virtual

Fills gradient.

If Linear then solution may be NULL, also returns true value of function and offset so we can use x not deltaX in constraint If refresh is false then uses last solution Uses model for scaling Returns non-zero if gradient udefined at current solution

Implements ClpConstraint.

◆ resize()

virtual void ClpConstraintLinear::resize ( int newNumberColumns)
virtual

Resize constraint.

Implements ClpConstraint.

◆ deleteSome()

virtual void ClpConstraintLinear::deleteSome ( int numberToDelete,
const int * which )
virtual

Delete columns in constraint.

Implements ClpConstraint.

◆ reallyScale()

virtual void ClpConstraintLinear::reallyScale ( const double * columnScale)
virtual

Scale constraint.

Implements ClpConstraint.

◆ markNonlinear()

virtual int ClpConstraintLinear::markNonlinear ( char * which) const
virtual

Given a zeroed array sets nonlinear columns to 1.

Returns number of nonlinear columns

Implements ClpConstraint.

◆ markNonzero()

virtual int ClpConstraintLinear::markNonzero ( char * which) const
virtual

Given a zeroed array sets possible nonzero coefficients to 1.

Returns number of nonzeros

Implements ClpConstraint.

◆ operator=()

ClpConstraintLinear & ClpConstraintLinear::operator= ( const ClpConstraintLinear & rhs)

Assignment operator.

◆ clone()

virtual ClpConstraint * ClpConstraintLinear::clone ( ) const
virtual

Clone.

Implements ClpConstraint.

◆ numberCoefficients()

virtual int ClpConstraintLinear::numberCoefficients ( ) const
virtual

Number of coefficients.

Implements ClpConstraint.

◆ numberColumns()

int ClpConstraintLinear::numberColumns ( ) const
inline

Number of columns in linear constraint.

Definition at line 79 of file ClpConstraintLinear.hpp.

◆ column()

const int * ClpConstraintLinear::column ( ) const
inline

Columns.

Definition at line 84 of file ClpConstraintLinear.hpp.

◆ coefficient()

const double * ClpConstraintLinear::coefficient ( ) const
inline

Coefficients.

Definition at line 89 of file ClpConstraintLinear.hpp.

Member Data Documentation

◆ column_

int* ClpConstraintLinear::column_
private

Definition at line 100 of file ClpConstraintLinear.hpp.

◆ coefficient_

double* ClpConstraintLinear::coefficient_
private

Coefficients.

Definition at line 102 of file ClpConstraintLinear.hpp.

◆ numberColumns_

int ClpConstraintLinear::numberColumns_
private

Useful to have number of columns about.

Definition at line 104 of file ClpConstraintLinear.hpp.

◆ numberCoefficients_

int ClpConstraintLinear::numberCoefficients_
private

Number of coefficients.

Definition at line 106 of file ClpConstraintLinear.hpp.


The documentation for this class was generated from the following file: