Product term. More...
#include <ConstraintTerm.hpp>


Public Types | |
| typedef multimap< string, ROCPPVarIF_Ptr > | varMapType |
| Multimap from string to decision variable. More... | |
| typedef multimap< string, ROCPPUnc_Ptr > | uncMapType |
| Multimap from string to uncertain parameter. More... | |
| typedef multimap< string, ROCPPVarIF_Ptr >::const_iterator | varsIterator |
| Constant iterator for decision variable map (m_DVMap) More... | |
| typedef multimap< string, ROCPPUnc_Ptr >::const_iterator | uncIterator |
| Constant iterator for uncertain parameter map (m_UncMap) More... | |
Public Types inherited from ConstraintTermIF | |
| typedef dvMapType::const_iterator | dvIterator |
| Constant iterator for product term decision variable map. More... | |
| typedef uncMapType::const_iterator | uncIterator |
| Constant iterator for product term uncertain parameter map. More... | |
Public Member Functions | |
| ProductTerm (double c) | |
| Constructor of the ProductTerm class. More... | |
| ProductTerm (double c, ROCPPVarIF_Ptr pVariable) | |
| Constructor of the ProductTerm class. More... | |
| ProductTerm (double c, ROCPPUnc_Ptr pUncertainty, ROCPPVarIF_Ptr pVariable) | |
| Constructor of the ProductTerm class. More... | |
| ProductTerm (double c, ROCPPUnc_Ptr pUncertainty) | |
| Constructor of the ProductTerm class. More... | |
| ProductTerm (double c, ROCPPVarIF_Ptr pVariable1, ROCPPVarIF_Ptr pVariable2) | |
| Constructor of the ProductTerm class. More... | |
| ProductTerm (double c, ROCPPUnc_Ptr pUncertainty, ROCPPVarIF_Ptr pVariable1, ROCPPVarIF_Ptr pVariable2) | |
| Constructor of the ProductTerm class. More... | |
| ProductTerm (double c, const vector< ROCPPUnc_Ptr > &uncVec, const vector< ROCPPVarIF_Ptr > &varVec) | |
| Constructor of the ProductTerm class. More... | |
| ~ProductTerm () | |
| Destructor of the ProductTerm class. More... | |
| bool | operator== (const ProductTerm &other) const |
| Check it two terms are equal. More... | |
| void | operator*= (ROCPPconstCstrTermIF_Ptr term) |
| Multiply this object with the given term. More... | |
| void | operator*= (ROCPPVarIF_Ptr var) |
| Multiply this object with the given decision variable. More... | |
| void | operator*= (ROCPPUnc_Ptr unc) |
| Multiply this object with the given uncertainty. More... | |
| void | operator*= (double a) |
| Multiply this object with the given coefficient␐␐␐. More... | |
| varsIterator | varsBegin () const |
| Return a pointer to the begining of the decision variable map (m_DVMap) More... | |
| varsIterator | varsEnd () const |
| Return a pointer to the end of the decision variable map (m_DVMap) More... | |
| uncIterator | uncBegin () const |
| Return a pointer to the begining of the uncertain parameter map (m_UncMap) More... | |
| uncIterator | uncEnd () const |
| Return a pointer to the end of the uncertain parameter map (m_UncMap) More... | |
| pair< bool, ROCPPCstrTermIF_Ptr > | factorOut (ROCPPUnc_Ptr unc) const |
| Calculate the coeffiecient of the given uncertainty. More... | |
| ROCPPCstrTermIF_Ptr | mapTermVars (const map< string, ROCPPVarIF_Ptr > &mapFromOldToNewVars) const |
| Map the old decision variables in this term to new variables. More... | |
| ROCPPCstrTermIF_Ptr | mapTermUnc (const map< string, ROCPPUnc_Ptr > &mapFromOldToNewUnc) const |
| Map the old uncertain parameters in this term to new uncertainties. More... | |
| ROCPPExpr_Ptr | mapVars (const map< string, ROCPPExpr_Ptr > &mapFromVarToExpression) const |
| Map the old variables in this term to expressions. More... | |
| ROCPPExpr_Ptr | mapUncs (const map< string, ROCPPExpr_Ptr > &mapFromUncToExpression) const |
| Map the old uncertainties in this term to expressions. More... | |
| ROCPPCstrTermIF_Ptr | replaceTermWithVar (const multimap< string, ROCPPVarIF_Ptr > &term, ROCPPVarIF_Ptr var) const |
| Replace the given term in this term with the given decision variable. More... | |
| void | add (ROCPPconstCstrTermIF_Ptr other) |
| Add a given constraint term to this term. More... | |
| void | add_vars_involved_in_prod (dvContainer &dvs) const |
| Add the decisions variables involved in a product in this term to the given container dvs. More... | |
| double | evaluate (const map< string, double > &valuesMap) const |
| Calculate the value of this term. More... | |
| constraintTermType | getType () const |
| Return the type of the term. More... | |
| bool | isProductTerm () const |
| Return true if and only if the term is of type prodTerm. More... | |
| bool | hasNonlinearities () const |
| Return true if and only if there is a product between two decision variables in this term. More... | |
| bool | hasProdsUncertainties () const |
| Return true if and only if there is a product between two uncertainties in this term. More... | |
| bool | hasProdsContVars () const |
| Return true if and only if there is a product between two continuous variables in this term. More... | |
| bool | isConstant () const |
| Return true if and only if the term is just a constant. More... | |
| bool | isDeterministic () const |
| Return true if and only if the term is deterministic. More... | |
| bool | isLinear () const |
| Return true if and only if the term is linear. More... | |
| bool | isQuadratic () const |
| Return true if and only if the term is quadratic. More... | |
| double | getCoeff () const |
| Return the coefficient (a double type) of this object. More... | |
| bool | isWellDefined () const |
| Return true if and only if this object is not empty. More... | |
| bool | is_same (ROCPPconstCstrTermIF_Ptr other) const |
| Return true if and only if the given constraint term is the same as this object. More... | |
| uint | getNumTimesTermAppears (const multimap< string, ROCPPVarIF_Ptr > &term) const |
| Get the number of times the given term appears in this object. More... | |
| void | getAllProductsOf2Variables (map< pair< string, string >, uint > &freqMap, map< pair< string, string >, multimap< string, ROCPPVarIF_Ptr > > &termMap) const |
| Get the products of any two variables in this term. More... | |
| ROCPPCstrTermIF_Ptr | Clone () const |
| Clone this term and return a pointer to the clone. More... | |
| void | WriteToStream (ofstream &ofs) const |
| Print this term to the stream ofs. More... | |
Public Member Functions inherited from ConstraintTermIF | |
| ConstraintTermIF () | |
| Constructor of the ConstraintTermIF class. More... | |
| virtual | ~ConstraintTermIF () |
| Destructor of the ConstraintTermIF class. More... | |
| dvIterator | varsBegin () const |
| Return a constant iterator pointing to the beginning of the decision variable map (m_pDVContainer) More... | |
| dvIterator | varsEnd () const |
| Return a constant iterator pointing to the end of the decision variable map (m_pDVContainer) More... | |
| uncIterator | uncBegin () const |
| Return a constant iterator pointing to the beginning of the uncertain parameter map (m_pUncContainer) More... | |
| uncIterator | uncEnd () const |
| Return a constant iterator pointing to the end of the uncertain parameter map (m_pUncContainer) More... | |
| void | add_int_vars (dvContainer &dvs) const |
| Add the integer variables in this term to the given container. More... | |
| virtual bool | isNonlinearProdTerm () const |
| Return true if and only if the term is a product term and is nonlinear, i.e., if it involves products of decision variables. More... | |
| virtual bool | isNormTerm () const |
| Return true if and only if the term is of type normTerm. More... | |
| ROCPPconstdvContainer_Ptr | getDVContainer () const |
| Return the decision variable container (m_dvContainer) of this object. More... | |
| ROCPPconstuncContainer_Ptr | getUncContainer () const |
| Return the uncertainty container (m_uncContainer) in this object. More... | |
| uint | getNumContVars () const |
| Return the number of real-valued decision variables in this term. More... | |
| uint | getNumIntVars () const |
| Return the number of integer decision variables in this term. More... | |
| uint | getNumBoolVars () const |
| Return the number of boolen decision variables in this term. More... | |
| uint | getNumAdaptiveContVars () const |
| Return the number of adaptive real-valued decision variables in this term. More... | |
| uint | getNumAdaptiveVars () const |
| Return the number of adaptive decision variables in this term. More... | |
| size_t | getNumUncertainties () const |
| Return the number of uncertain parameters in this term. More... | |
| size_t | getNumVars () const |
| Return the number of decision variables in this term. More... | |
| bool | allIntVarsBounded () const |
| Return true if and only if all integer decision variables in this term are bounded. More... | |
Private Member Functions | |
| void | addVariable (ROCPPVarIF_Ptr pVariable) |
| Multiply the term by pVariable. More... | |
| void | addUncertainty (ROCPPUnc_Ptr pUncertainty) |
| Multiply the term by pUncertainty. More... | |
Private Attributes | |
| double | m_coeff |
| Coefficient of this term. More... | |
| multimap< string, ROCPPVarIF_Ptr > | m_DVMap |
| Multimap from decision variable name to decision variable. The variable appears in the map as many times as it is present in the term. More... | |
| multimap< string, ROCPPUnc_Ptr > | m_UncMap |
| Multimap from uncertain parameter name to the uncertain parameter. The uncertain parameter appears in the map as many times as it is present in the term. More... | |
Additional Inherited Members | |
Protected Attributes inherited from ConstraintTermIF | |
| ROCPPdvContainer_Ptr | m_pDVContainer |
| Decision variable container. More... | |
| ROCPPuncContainer_Ptr | m_pUncContainer |
| Uncertain parameter container. More... | |
Product term.
Term for product of coefficient, decision variables, and uncertainties (monomial)
| typedef multimap<string, ROCPPUnc_Ptr>::const_iterator ProductTerm::uncIterator |
Constant iterator for uncertain parameter map (m_UncMap)
| typedef multimap<string, ROCPPUnc_Ptr> ProductTerm::uncMapType |
Multimap from string to uncertain parameter.
| typedef multimap<string, ROCPPVarIF_Ptr> ProductTerm::varMapType |
Multimap from string to decision variable.
| typedef multimap<string, ROCPPVarIF_Ptr>::const_iterator ProductTerm::varsIterator |
Constant iterator for decision variable map (m_DVMap)
| ProductTerm::ProductTerm | ( | double | c | ) |
Constructor of the ProductTerm class.
| c | coefficient |
| ProductTerm::ProductTerm | ( | double | c, |
| ROCPPVarIF_Ptr | pVariable | ||
| ) |
Constructor of the ProductTerm class.
| c | coefficient |
| pVariable | decision variable involved in the product term |
| ProductTerm::ProductTerm | ( | double | c, |
| ROCPPUnc_Ptr | pUncertainty, | ||
| ROCPPVarIF_Ptr | pVariable | ||
| ) |
Constructor of the ProductTerm class.
| c | coefficient |
| pUncertainty | uncertain parameter involved in the product term |
| pVariable | decision variable involved in the product term |
| ProductTerm::ProductTerm | ( | double | c, |
| ROCPPUnc_Ptr | pUncertainty | ||
| ) |
Constructor of the ProductTerm class.
| c | coefficient |
| pUncertainty | uncertain parameter involved in the product term |
| ProductTerm::ProductTerm | ( | double | c, |
| ROCPPVarIF_Ptr | pVariable1, | ||
| ROCPPVarIF_Ptr | pVariable2 | ||
| ) |
Constructor of the ProductTerm class.
| c | coefficient |
| pVariable1 | first decision variable involved in the product term |
| pVariable2 | second decision variable involved in the product term |
| ProductTerm::ProductTerm | ( | double | c, |
| ROCPPUnc_Ptr | pUncertainty, | ||
| ROCPPVarIF_Ptr | pVariable1, | ||
| ROCPPVarIF_Ptr | pVariable2 | ||
| ) |
Constructor of the ProductTerm class.
| c | coefficient |
| pUncertainty | uncertain parameter involved in the product term |
| pVariable1 | first decision variable involved in the product term |
| pVariable2 | second decision variable involved in the product term |
| ProductTerm::ProductTerm | ( | double | c, |
| const vector< ROCPPUnc_Ptr > & | uncVec, | ||
| const vector< ROCPPVarIF_Ptr > & | varVec | ||
| ) |
Constructor of the ProductTerm class.
| c | coefficient |
| uncVec | vector of uncetainties involved in the product term |
| varVec | vector of decision variables involved in the product term |
|
inline |
Destructor of the ProductTerm class.
|
virtual |
Add a given constraint term to this term.
Reimplemented from ConstraintTermIF.
|
virtual |
Add the decisions variables involved in a product in this term to the given container dvs.
Implements ConstraintTermIF.
|
private |
Multiply the term by pUncertainty.
| pUncertainty | uncertain parameter that will multiply this term |
|
private |
Multiply the term by pVariable.
| pVariable | decision variable that will multiply this term |
|
virtual |
Clone this term and return a pointer to the clone.
Implements ConstraintTermIF.
|
virtual |
Calculate the value of this term.
| valuesMap | a map from name of the variable to its value |
Implements ConstraintTermIF.
|
virtual |
Calculate the coeffiecient of the given uncertainty.
Reimplemented from ConstraintTermIF.
|
virtual |
Get the products of any two variables in this term.
| freqMap | map from the pair of the variable names in each product to the frequency of this product |
| termMap | map from the pair of the variable names in each product to the map of the name to the variable involved in the product |
Implements ConstraintTermIF.
|
inlinevirtual |
Return the coefficient (a double type) of this object.
Reimplemented from ConstraintTermIF.
|
virtual |
Get the number of times the given term appears in this object.
| term | map from name of the variable to the pointer of the variable involved in the term |
Implements ConstraintTermIF.
|
virtual |
|
virtual |
Return true if and only if there is a product between two decision variables in this term.
Implements ConstraintTermIF.
|
virtual |
Return true if and only if there is a product between two continuous variables in this term.
Implements ConstraintTermIF.
|
virtual |
Return true if and only if there is a product between two uncertainties in this term.
Implements ConstraintTermIF.
|
virtual |
Return true if and only if the given constraint term is the same as this object.
Implements ConstraintTermIF.
|
inlinevirtual |
Return true if and only if the term is just a constant.
Reimplemented from ConstraintTermIF.
|
inlinevirtual |
Return true if and only if the term is deterministic.
Reimplemented from ConstraintTermIF.
|
inlinevirtual |
Return true if and only if the term is linear.
Reimplemented from ConstraintTermIF.
|
inlinevirtual |
Return true if and only if the term is of type prodTerm.
Reimplemented from ConstraintTermIF.
|
inlinevirtual |
Return true if and only if the term is quadratic.
Reimplemented from ConstraintTermIF.
|
inlinevirtual |
Return true if and only if this object is not empty.
Implements ConstraintTermIF.
|
virtual |
Map the old uncertain parameters in this term to new uncertainties.
| mapFromOldToNewUnc | map from old uncertainty name to new uncertainty pointer |
Implements ConstraintTermIF.
|
virtual |
Map the old decision variables in this term to new variables.
| mapFromOldToNewVars | map from old variable name to new variable pointer |
Implements ConstraintTermIF.
|
virtual |
Map the old uncertainties in this term to expressions.
| mapFromUncToExpression | map from uncertain parameter names to pointers to expressions |
Implements ConstraintTermIF.
|
virtual |
Map the old variables in this term to expressions.
| mapFromVarToExpression | map from old variables names to pointers to expressions |
Implements ConstraintTermIF.
|
inlinevirtual |
Multiply this object with the given coefficient␐␐␐.
Reimplemented from ConstraintTermIF.
|
virtual |
Multiply this object with the given term.
Reimplemented from ConstraintTermIF.
|
inlinevirtual |
Multiply this object with the given uncertainty.
Reimplemented from ConstraintTermIF.
|
inlinevirtual |
Multiply this object with the given decision variable.
Reimplemented from ConstraintTermIF.
|
virtual |
|
virtual |
Replace the given term in this term with the given decision variable.
| term | map including the decision variables in the term to be replaced |
| var | variable used to replace the term |
Implements ConstraintTermIF.
|
inline |
Return a pointer to the begining of the uncertain parameter map (m_UncMap)
|
inline |
Return a pointer to the end of the uncertain parameter map (m_UncMap)
|
inline |
Return a pointer to the begining of the decision variable map (m_DVMap)
|
inline |
Return a pointer to the end of the decision variable map (m_DVMap)
|
virtual |
|
private |
Coefficient of this term.
|
private |
Multimap from decision variable name to decision variable. The variable appears in the map as many times as it is present in the term.
|
private |
Multimap from uncertain parameter name to the uncertain parameter. The uncertain parameter appears in the map as many times as it is present in the term.