ROC++  v1.2
Automatic Robust Optimization in C++
EqConstraint Class Reference

Equality constraint. More...

#include <Constraint.hpp>

Inheritance diagram for EqConstraint:
Collaboration diagram for EqConstraint:

Public Member Functions

 EqConstraint (bool definesUncertaintySet=false, bool isNAC=false)
 Constructor of equality constraint. More...
 
 ~EqConstraint ()
 Destructor of equality constraint. More...
 
bool isEqConstraint () const
 
bool isUseful (double epsilon) 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...
 
- Public Member Functions inherited from ClassicConstraintIF
 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...
 
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...
 
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...
 

Additional Inherited Members

- Public Types inherited from ClassicConstraintIF
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...
 
- 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...
 

Detailed Description

Equality constraint.

Constructor & Destructor Documentation

◆ EqConstraint()

EqConstraint::EqConstraint ( bool  definesUncertaintySet = false,
bool  isNAC = false 
)
inline

Constructor of equality constraint.

Parameters
definesUncertaintySettrue if and only if this constraint is used to define the uncertainty set
isNACtrue if and only if this constraint is a non-anticipativity constraint

◆ ~EqConstraint()

EqConstraint::~EqConstraint ( )
inline

Destructor of equality constraint.

Member Function Documentation

◆ isEqConstraint()

bool EqConstraint::isEqConstraint ( ) const
inlinevirtual

Implements ClassicConstraintIF.

◆ isUseful()

bool EqConstraint::isUseful ( double  epsilon) const
virtual

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)

Reimplemented from ConstraintIF.