Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set
// doxy/ or-tools/ src/ linear_solver/

operations_research::MPConstraint Class Reference

The class for constraints of a Mathematical Programming (MP) model. More...

#include <linear_solver.h>

List of all members.

Public Member Functions

const string & name () const
 Returns the name of the constraint.
void Clear ()
 Clears all variables and coefficients. Does not clear the bounds.
void SetCoefficient (const MPVariable *const var, double coeff)
 Sets the coefficient of the variable on the constraint.
double GetCoefficient (const MPVariable *const var) const
 Gets the coefficient of a given variable on the constraint (which is 0 if the variable does not appear in the constraint).
double lb () const
 Returns the lower bound.
double ub () const
 Returns the upper bound.
void SetLB (double lb)
 Sets the lower bound.
void SetUB (double ub)
 Sets the upper bound.
void SetBounds (double lb, double ub)
 Sets both the lower and upper bounds.
double activity () const
 Returns the constraint's activity in the current solution: sum over all terms of (coefficient * variable value).
int index () const
 Returns the index of the constraint in the MPSolver::constraints_.
double dual_value () const
 Advanced usage: returns the dual value of the constraint in the current solution (only available for continuous problems).
MPSolver::BasisStatus basis_status () const
 Advanced usage: returns the basis status of the slack variable associated with the constraint (only available for continuous problems).

Protected Member Functions

 MPConstraint (double lb, double ub, const string &name, MPSolverInterface *const interface)
 Constructor.
void set_index (int index)
void set_activity (double activity)
void set_dual_value (double dual_value)

Friends

class MPSolver
class MPSolverInterface
class CBCInterface
class CLPInterface
class GLPKInterface
class SCIPInterface


Detailed Description

The class for constraints of a Mathematical Programming (MP) model.

A constraint is represented as a linear equation or inequality.

Definition at line 623 of file linear_solver.h.


Constructor & Destructor Documentation

operations_research::MPConstraint::MPConstraint ( double  lb,
double  ub,
const string &  name,
MPSolverInterface *const   interface 
) [inline, protected]

Constructor.

A constraint points to a single MPSolverInterface that is specified in the constructor. A constraint cannot belong to several models.

Definition at line 676 of file linear_solver.h.


Member Function Documentation

const string& operations_research::MPConstraint::name (  )  const [inline]

Returns the name of the constraint.

Definition at line 626 of file linear_solver.h.

void operations_research::MPConstraint::Clear (  ) 

Clears all variables and coefficients. Does not clear the bounds.

Definition at line 76 of file linear_solver.cc.

void operations_research::MPConstraint::SetCoefficient ( const MPVariable *const   var,
double  coeff 
)

Sets the coefficient of the variable on the constraint.

Definition at line 49 of file linear_solver.cc.

double operations_research::MPConstraint::GetCoefficient ( const MPVariable *const   var  )  const

Gets the coefficient of a given variable on the constraint (which is 0 if the variable does not appear in the constraint).

Definition at line 45 of file linear_solver.cc.

double operations_research::MPConstraint::lb (  )  const [inline]

Returns the lower bound.

Definition at line 638 of file linear_solver.h.

double operations_research::MPConstraint::ub (  )  const [inline]

Returns the upper bound.

Definition at line 640 of file linear_solver.h.

void operations_research::MPConstraint::SetLB ( double  lb  )  [inline]

Sets the lower bound.

Definition at line 642 of file linear_solver.h.

void operations_research::MPConstraint::SetUB ( double  ub  )  [inline]

Sets the upper bound.

Definition at line 644 of file linear_solver.h.

void operations_research::MPConstraint::SetBounds ( double  lb,
double  ub 
)

Sets both the lower and upper bounds.

Definition at line 81 of file linear_solver.cc.

double operations_research::MPConstraint::activity (  )  const

Returns the constraint's activity in the current solution: sum over all terms of (coefficient * variable value).

Definition at line 105 of file linear_solver.cc.

int operations_research::MPConstraint::index (  )  const [inline]

Returns the index of the constraint in the MPSolver::constraints_.

Todo:
TODO(user): move to protected.

Definition at line 654 of file linear_solver.h.

double operations_research::MPConstraint::dual_value (  )  const

Advanced usage: returns the dual value of the constraint in the current solution (only available for continuous problems).

Definition at line 90 of file linear_solver.cc.

MPSolver::BasisStatus operations_research::MPConstraint::basis_status (  )  const

Advanced usage: returns the basis status of the slack variable associated with the constraint (only available for continuous problems).

See also:
MPSolver::BasisStatus.

Definition at line 97 of file linear_solver.cc.

void operations_research::MPConstraint::set_index ( int  index  )  [inline, protected]

Definition at line 683 of file linear_solver.h.

void operations_research::MPConstraint::set_activity ( double  activity  )  [inline, protected]

Definition at line 684 of file linear_solver.h.

void operations_research::MPConstraint::set_dual_value ( double  dual_value  )  [inline, protected]

Definition at line 685 of file linear_solver.h.


Friends And Related Function Documentation

friend class MPSolver [friend]

Definition at line 666 of file linear_solver.h.

friend class MPSolverInterface [friend]

Definition at line 667 of file linear_solver.h.

friend class CBCInterface [friend]

Definition at line 668 of file linear_solver.h.

friend class CLPInterface [friend]

Definition at line 669 of file linear_solver.h.

friend class GLPKInterface [friend]

Definition at line 670 of file linear_solver.h.

friend class SCIPInterface [friend]

Definition at line 671 of file linear_solver.h.


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