Classic constraint interface class. More...
#include <Constraint.hpp>


Public Types | |
| typedef ConstraintLHS_const_iterator | const_iterator |
| Constant iterator in LHSExpression terms. More... | |
| typedef uncMapType::const_iterator | uncertaintiesIterator |
| Constant iterator in the uncertain parameter map. More... | |
Public Types inherited from ConstraintIF | |
| typedef dvMapType::const_iterator | varsIterator |
| Constant iterator in decision variable map. More... | |
Public Member Functions | |
| ClassicConstraintIF (bool definesUncertaintySet, bool isNAC=false) | |
| Constructor of classic constraint class. More... | |
| ~ClassicConstraintIF () | |
| Destructor of classic constraint class. More... | |
| const_iterator | begin () const |
| const_iterator | end () const |
| varsIterator | varsBegin () const |
| varsIterator | varsEnd () const |
| uncertaintiesIterator | uncertaintiesBegin () const |
| uncertaintiesIterator | uncertaintiesEnd () const |
| void | add_lhs (double c) |
| Create a new ProductTerm using the given input and add it to the left hand side of this constraint. More... | |
| void | add_lhs (double c, ROCPPVarIF_Ptr pVariable) |
| Create a new ProductTerm using the given inputs and add it to the left hand side of this constraint. More... | |
| void | add_lhs (double c, ROCPPUnc_Ptr pUncertainty, ROCPPVarIF_Ptr pVariable) |
| Create a new ProductTerm using the given inputs and add it to the left hand side of this constraint. More... | |
| void | add_lhs (double c, ROCPPUnc_Ptr pUncertainty) |
| Create a new ProductTerm using the given inputs and add it to the left hand side of this constraint. More... | |
| void | add_lhs (double c, ROCPPVarIF_Ptr pVariable1, ROCPPVarIF_Ptr pVariable2) |
| Create a new ProductTerm using the given inputs and add it to the left hand side of this constraint. More... | |
| void | add_lhs (double c, ROCPPUnc_Ptr pUncertainty, ROCPPVarIF_Ptr pVariable1, ROCPPVarIF_Ptr pVariable2) |
| Create a new ProductTerm using the given inputs and add it to the left hand side of this constraint. More... | |
| void | add_lhs (ROCPPconstCstrTermIF_Ptr term) |
| Add the given term to the left hand side of this constraint. More... | |
| void | add_lhs (double c, ROCPPconstCstrTermIF_Ptr term) |
| Add the product of the given inputs into the left hand side of this constraint. More... | |
| void | add_lhs (ROCPPconstExpr_Ptr pExpression) |
| Add the given expression to the left hand side of this constraint. More... | |
| void | add_lhs (double c, ROCPPconstExpr_Ptr pExpression) |
| Add the given expression multiplied by c to the left hand side of this constraint. More... | |
| void | add_lhs (double c, ROCPPconstExpr_Ptr pExpression, ROCPPVarIF_Ptr pVariable) |
| Add the product of the given inputs to the left hand side of this constraint. More... | |
| void | set_rhs (pair< double, bool > rhs) |
| Set right-hand side parameter of this constraint. More... | |
| ROCPPConstraintIF_Ptr | mapVars (const map< string, ROCPPExpr_Ptr > &mapFromVarToExpression) const |
| ROCPPConstraintIF_Ptr | mapUncs (const map< string, ROCPPExpr_Ptr > &mapFromUncToExpression) const |
| ROCPPConstraintIF_Ptr | replaceTermWithVar (const multimap< string, ROCPPVarIF_Ptr > &term, ROCPPVarIF_Ptr var) const |
| ROCPPConstraintIF_Ptr | replaceBilinearTerm (map< pair< string, string >, ROCPPVarIF_Ptr > &allTerm, uint &count) const |
| ROCPPConstraintIF_Ptr | mapVars (const map< string, ROCPPVarIF_Ptr > &mapFromOldToNewVars) const |
| ROCPPConstraintIF_Ptr | mapUnc (const map< string, ROCPPUnc_Ptr > &mapFromOldToNewUnc) const |
| void | add_vars_involved_in_prod (dvContainer &dvs) const |
| void | add_int_vars (dvContainer &dvs) const |
| uint | getNumTimesTermAppears (const multimap< string, ROCPPVarIF_Ptr > &term) const |
| void | getAllProductsOf2Variables (map< pair< string, string >, uint > &freqMap, map< pair< string, string >, multimap< string, ROCPPVarIF_Ptr > > &termMap) const |
| ROCPPconstdvContainer_Ptr | getDVContainer () const |
| Get the decision variable container of this constraint. More... | |
| ROCPPconstuncContainer_Ptr | getUncContainer () const |
| Get the uncertain parameter container of this constraint. More... | |
| uint | getNumContVars () const |
| Get the number of real-valued decision variables in this constraint. More... | |
| uint | getNumIntVars () const |
| Get the number of integer decision variables in this constraint. More... | |
| uint | getNumBoolVars () const |
| Get the number of boolean variables in this constraint. More... | |
| uint | getNumAdaptiveContVars () const |
| Get the number of adaptive real-valued decision variables in this constraint. More... | |
| uint | getNumAdaptiveVars () const |
| Get the number of adaptive decision variables in this constraint. More... | |
| uint | getTimeStage () const |
| Get the maximum time-stage of any decision variable in the constraint. More... | |
| size_t | getNumUncertainties () const |
| Get the number of uncertaint parameters in the constraint. More... | |
| bool | hasNonlinearities () const |
| bool | hasProdsUncertainties () const |
| bool | hasProdsContVars () const |
| bool | isWellDefined () const |
| Return true if the LHExpression::isWellDefined() is true and the right-hand side parameter is set. More... | |
| bool | hasNoDVs () const |
| Return true if and only if the constraint has no decision variables. More... | |
| bool | isClassicConstraint () const |
| Return true if and only if the constraint is a classic (equality or inequality) constraint. More... | |
| virtual bool | isEqConstraint () const =0 |
| bool | AnyVarIsInvolved (dvContainer &dvs) const |
| bool | hasNormTerm () const |
| Return true if and only if the constraint has a norm term. More... | |
| bool | isLinear () const |
| bool | isQuadratic () const |
| pair< double, bool > | get_rhs () const |
| ROCPPExpr_Ptr | getLHS () const |
| ROCPPExpr_Ptr | getLinearPart () const |
| Get the part without norm term in the left-hand side expression of this constraint. More... | |
| ROCPPNormTerm_Ptr | getNormTerm () const |
| Get the norm term in the left-hand side expression of this constraint. More... | |
| ROCPPConstraintIF_Ptr | Clone () const |
| Set the right hand side of this constraint. More... | |
| void | WriteToStream (ofstream &ofs, uint cnt) const |
| Write the constraint to a stream. More... | |
Public Member Functions inherited from ConstraintIF | |
| ConstraintIF (bool definesUncertaintySet, bool isNAC=false) | |
| Constructor of the constraint interface class. More... | |
| virtual | ~ConstraintIF () |
| Destructor of the constraint interface class. More... | |
| bool | definesUncertaintySet () const |
| Return true if and only if this constraint defines the uncertainty set. More... | |
| bool | isDeterministic () const |
| Return true if and only if this constraint does not involve any uncertain parameters. More... | |
| virtual bool | isUseful (double epsilon=1.e-10) const |
| Return false if and only if the left hand side is constant and the left and right hand side constants are equal, within epsilon (this constraint can be deleted) More... | |
| bool | isNAC () const |
| Return true if and only if the constraint is a non-anticipativity constraint (useful for problems with decision-dependent information discovery) More... | |
| virtual bool | isSOSConstraint () const |
| Return true if and only if the constraint is SOS. More... | |
| virtual bool | isIfThenConstraint () const |
| Return true if and only if the constraint is a logical if then constraint (useful in CPLEX solver) More... | |
| void | setParams (bool defUncertaintyset, bool isNAC) |
| Set the paramaters of this constraint. More... | |
Private Attributes | |
| ROCPPExpr_Ptr | m_pLHS |
| Left-hand side expression of this constraint. More... | |
| rhsParams | m_rhsParams |
| Right-hand side parameter of this constraint. More... | |
Additional Inherited Members | |
Protected Attributes inherited from ConstraintIF | |
| bool | m_definesUncertaintySet |
| Indicate whether this constraint defines uncertainty set or not. More... | |
| bool | m_isNAC |
| Indicate whether this constraint is a non-anticipativity constraint or not. More... | |
Classic constraint interface class.
Constant iterator in LHSExpression terms.
| typedef uncMapType::const_iterator ClassicConstraintIF::uncertaintiesIterator |
Constant iterator in the uncertain parameter map.
| ClassicConstraintIF::ClassicConstraintIF | ( | bool | definesUncertaintySet, |
| bool | isNAC = false |
||
| ) |
Constructor of classic constraint class.
| definesUncertaintySet | true if and only if this constraint is used to define the uncertainty set |
| isNAC | true if and only if this constraint is a non-anticipativity constraint |
|
inline |
Destructor of classic constraint class.
|
virtual |
Implements ConstraintIF.
| void ClassicConstraintIF::add_lhs | ( | double | c | ) |
Create a new ProductTerm using the given input and add it to the left hand side of this constraint.
| c | constant to add to the expression |
| void ClassicConstraintIF::add_lhs | ( | double | c, |
| ROCPPconstCstrTermIF_Ptr | term | ||
| ) |
Add the product of the given inputs into the left hand side of this constraint.
| c | coefficient |
| term | term to add to expression after multiplying it by coefficient |
| void ClassicConstraintIF::add_lhs | ( | double | c, |
| ROCPPconstExpr_Ptr | pExpression | ||
| ) |
Add the given expression multiplied by c to the left hand side of this constraint.
| c | coefficient |
| pExpression | expression to add to this expression after multiplying it by coefficient c |
| void ClassicConstraintIF::add_lhs | ( | double | c, |
| ROCPPconstExpr_Ptr | pExpression, | ||
| ROCPPVarIF_Ptr | pVariable | ||
| ) |
Add the product of the given inputs to the left hand side of this constraint.
| c | coefficient |
| pVariable | decision variable |
| pExpression | expression to add to this expression after multiplying it by coefficient c and by decision variable pVariable |
| void ClassicConstraintIF::add_lhs | ( | double | c, |
| ROCPPUnc_Ptr | pUncertainty | ||
| ) |
Create a new ProductTerm using the given inputs and add it to the left hand side of this constraint.
| c | coefficient of the term to add |
| pUncertainty | uncertain parameter of the term to add |
| void ClassicConstraintIF::add_lhs | ( | double | c, |
| ROCPPUnc_Ptr | pUncertainty, | ||
| ROCPPVarIF_Ptr | pVariable | ||
| ) |
Create a new ProductTerm using the given inputs and add it to the left hand side of this constraint.
| c | coefficient of the term to add |
| pUncertainty | uncertain parameter of the term to add |
| pVariable | decision variable of the term to add |
| void ClassicConstraintIF::add_lhs | ( | double | c, |
| ROCPPUnc_Ptr | pUncertainty, | ||
| ROCPPVarIF_Ptr | pVariable1, | ||
| ROCPPVarIF_Ptr | pVariable2 | ||
| ) |
Create a new ProductTerm using the given inputs and add it to the left hand side of this constraint.
| c | coefficient of the term to add |
| pUncertainty | uncertain parameter of the term to add |
| pVariable1 | first decision variable of the term to add |
| pVariable2 | second decision variable of the term to add |
| void ClassicConstraintIF::add_lhs | ( | double | c, |
| ROCPPVarIF_Ptr | pVariable | ||
| ) |
Create a new ProductTerm using the given inputs and add it to the left hand side of this constraint.
| c | coefficient of the term to add |
| pVariable | decision variable of the term to add |
| void ClassicConstraintIF::add_lhs | ( | double | c, |
| ROCPPVarIF_Ptr | pVariable1, | ||
| ROCPPVarIF_Ptr | pVariable2 | ||
| ) |
Create a new ProductTerm using the given inputs and add it to the left hand side of this constraint.
| c | coefficient of the term to add |
| pVariable1 | first decision variable of the term to add |
| pVariable2 | second decision variable of the term to add |
| void ClassicConstraintIF::add_lhs | ( | ROCPPconstCstrTermIF_Ptr | term | ) |
Add the given term to the left hand side of this constraint.
| void ClassicConstraintIF::add_lhs | ( | ROCPPconstExpr_Ptr | pExpression | ) |
Add the given expression to the left hand side of this constraint.
| pExpression | expression to add to this expression after multiplying it by coefficient c |
|
virtual |
Implements ConstraintIF.
|
virtual |
Implements ConstraintIF.
| ClassicConstraintIF::const_iterator ClassicConstraintIF::begin | ( | ) | const |
|
virtual |
Set the right hand side of this constraint.
Implements ConstraintIF.
| ClassicConstraintIF::const_iterator ClassicConstraintIF::end | ( | ) | const |
| pair< double, bool > ClassicConstraintIF::get_rhs | ( | ) | const |
|
virtual |
Implements ConstraintIF.
|
virtual |
Get the decision variable container of this constraint.
Implements ConstraintIF.
| ROCPPExpr_Ptr ClassicConstraintIF::getLHS | ( | ) | const |
| ROCPPExpr_Ptr ClassicConstraintIF::getLinearPart | ( | ) | const |
Get the part without norm term in the left-hand side expression of this constraint.
| ROCPPNormTerm_Ptr ClassicConstraintIF::getNormTerm | ( | ) | const |
Get the norm term in the left-hand side expression of this constraint.
|
virtual |
Get the number of adaptive real-valued decision variables in this constraint.
Implements ConstraintIF.
|
virtual |
Get the number of adaptive decision variables in this constraint.
Implements ConstraintIF.
|
virtual |
Get the number of boolean variables in this constraint.
Implements ConstraintIF.
|
virtual |
Get the number of real-valued decision variables in this constraint.
Implements ConstraintIF.
|
virtual |
Get the number of integer decision variables in this constraint.
Implements ConstraintIF.
|
virtual |
Implements ConstraintIF.
|
virtual |
Get the number of uncertaint parameters in the constraint.
Implements ConstraintIF.
|
virtual |
Get the maximum time-stage of any decision variable in the constraint.
Implements ConstraintIF.
|
virtual |
Get the uncertain parameter container of this constraint.
Implements ConstraintIF.
|
virtual |
Return true if and only if the constraint has no decision variables.
Implements ConstraintIF.
|
virtual |
Implements ConstraintIF.
|
virtual |
Return true if and only if the constraint has a norm term.
Implements ConstraintIF.
|
virtual |
Implements ConstraintIF.
|
virtual |
Implements ConstraintIF.
|
inlinevirtual |
Return true if and only if the constraint is a classic (equality or inequality) constraint.
Reimplemented from ConstraintIF.
|
pure virtual |
Implemented in EqConstraint, and IneqConstraint.
| bool ClassicConstraintIF::isLinear | ( | ) | const |
| bool ClassicConstraintIF::isQuadratic | ( | ) | const |
|
virtual |
Return true if the LHExpression::isWellDefined() is true and the right-hand side parameter is set.
Implements ConstraintIF.
|
virtual |
Implements ConstraintIF.
|
virtual |
Implements ConstraintIF.
|
virtual |
Implements ConstraintIF.
|
virtual |
Implements ConstraintIF.
|
virtual |
Implements ConstraintIF.
|
virtual |
Implements ConstraintIF.
| void ClassicConstraintIF::set_rhs | ( | pair< double, bool > | rhs | ) |
Set right-hand side parameter of this constraint.
| rhs | first element of the pair is the right-hand side parameter, the second one is true if the parameter is 0, false otherwise |
| ClassicConstraintIF::uncertaintiesIterator ClassicConstraintIF::uncertaintiesBegin | ( | ) | const |
| ClassicConstraintIF::uncertaintiesIterator ClassicConstraintIF::uncertaintiesEnd | ( | ) | const |
|
virtual |
Implements ConstraintIF.
|
virtual |
Implements ConstraintIF.
|
virtual |
Write the constraint to a stream.
| ofs | output file stream |
| cnt | number (counter) of the constraint |
Implements ConstraintIF.
|
private |
Left-hand side expression of this constraint.
|
private |
Right-hand side parameter of this constraint.