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

Left hand-side expression class. More...

#include <ConstraintTerm.hpp>

Public Types

typedef vector< ROCPPCstrTermIF_Ptr >::const_iterator ConstraintLHS_const_iterator
 Constant iterator in vector of constraint terms. More...
 
typedef vector< ROCPPCstrTermIF_Ptr >::iterator ConstraintLHS_iterator
 Iterator in vector of constraint terms. More...
 
typedef ConstraintLHS_const_iterator const_iterator
 Constant iterator in vector of constraint terms. More...
 
typedef ConstraintLHS_iterator iterator
 Iterator in vector of constraint terms. More...
 
typedef dvMapType::const_iterator dvIterator
 Constant iterator in decision variable map. More...
 
typedef uncMapType::const_iterator uncIterator
 Constant iterator in uncertain parameter map. More...
 

Public Member Functions

 LHSExpression ()
 Constructor of LHSExpression. More...
 
 ~LHSExpression ()
 Destructor of LHSExpression. More...
 
const_iterator begin () const
 Return a constant iterator pointing to the beginning of m_terms in the expression. More...
 
const_iterator end () const
 Return a constant iterator pointing to the end of m_terms in the expression. More...
 
dvIterator varsBegin () const
 Return a constant iterator pointing to the beginning of the decision variable container (m_pDVContainer) More...
 
dvIterator varsEnd () const
 Return a constant iterator pointing to the end of the decision variable container m_pDVContainer. More...
 
uncIterator uncBegin () const
 Return a constaint iterator pointing to the beginning of the uncertain parameter container (m_pUncContainer) More...
 
uncIterator uncEnd () const
 Return a constant iterator pointing to the end of the uncertain parameter container (m_pUncContainer) More...
 
const_iterator find (ROCPPconstCstrTermIF_Ptr term) const
 Find a term in the expression. More...
 
void operator*= (ROCPPconstCstrTermIF_Ptr term)
 Multiply expression by given term. More...
 
void operator*= (ROCPPconstExpr_Ptr other)
 Multiply expression by given expression. More...
 
void operator*= (ROCPPUnc_Ptr unc)
 Multiply expression by given uncertain parameter. More...
 
void operator*= (ROCPPVarIF_Ptr var)
 Multiply expression by given decision variable. More...
 
void operator*= (double a)
 Multiply expression by given constant. More...
 
void operator+= (ROCPPUnc_Ptr unc)
 Add uncertain parameter to expression. More...
 
void operator+= (ROCPPVarIF_Ptr var)
 Add decision variable to expression. More...
 
void operator+= (ROCPPconstCstrTermIF_Ptr term)
 Add term to expression. More...
 
void operator+= (ROCPPconstExpr_Ptr other)
 Add expression to expression. More...
 
void operator+= (double a)
 Add constant to expression. More...
 
void add (double c)
 Create a new ProductTerm using the given input and add it to the expression. More...
 
void add (double c, ROCPPVarIF_Ptr pVariable)
 Create a new ProductTerm using the given inputs and add it to the expression. More...
 
void add (double c, ROCPPUnc_Ptr pUncertainty, ROCPPVarIF_Ptr pVariable)
 Create a new ProductTerm using the given inputs and add it to the expression. More...
 
void add (double c, ROCPPUnc_Ptr pUncertainty)
 Create a new ProductTerm using the given inputs and add it to the expression. More...
 
void add (double c, ROCPPVarIF_Ptr pVariable1, ROCPPVarIF_Ptr pVariable2)
 Create a new ProductTerm using the given inputs and add it to the expression. More...
 
void add (double c, ROCPPUnc_Ptr pUncertainty, ROCPPVarIF_Ptr pVariable1, ROCPPVarIF_Ptr pVariable2)
 Create a new ProductTerm using the given inputs and add it to the expression. More...
 
void add (ROCPPconstCstrTermIF_Ptr term)
 Add the given term to the expression. More...
 
void add (ROCPPconstExpr_Ptr expr)
 Add the given expression to this expression. More...
 
void add (double c, ROCPPconstCstrTermIF_Ptr term)
 Add the product of the given inputs into the expression. More...
 
void add (double c, ROCPPconstExpr_Ptr expr)
 Add the given expression multiplied by c to this expression. More...
 
void add (double c, ROCPPconstExpr_Ptr pExpression, ROCPPVarIF_Ptr pVariable)
 Add the product of the given inputs to the expression. More...
 
void add (double c, ROCPPconstExpr_Ptr pExpression, ROCPPUnc_Ptr pUnc)
 Add the product of the given inputs to the expression. More...
 
ROCPPExpr_Ptr mapExprVars (const map< string, ROCPPVarIF_Ptr > &mapFromOldToNewVars) const
 Map the old decision variables in this expression to new decision variables. More...
 
ROCPPExpr_Ptr mapExprUnc (const map< string, ROCPPUnc_Ptr > &mapFromOldToNewUnc) const
 Map the old uncertain parameters in this expression to new uncertain parameters. More...
 
ROCPPExpr_Ptr mapVars (const map< string, ROCPPExpr_Ptr > &mapFromVarToExpression) const
 Map the old variables in this expression to some expressions. More...
 
ROCPPExpr_Ptr mapUncs (const map< string, ROCPPExpr_Ptr > &mapFromUncToExpression) const
 Map the old uncertain parameters in this expression to some expressions. More...
 
ROCPPExpr_Ptr replaceTermWithVar (const multimap< string, ROCPPVarIF_Ptr > &term, ROCPPVarIF_Ptr var) const
 Replace the given term in this expression with the given decision variable. More...
 
ROCPPExpr_Ptr replaceBilinearTerm (map< pair< string, string >, ROCPPVarIF_Ptr > &allTerms, uint &count) const
 Replace the bilinear term in this object with the given decision variable. More...
 
pair< bool, ROCPPExpr_PtrfactorOut (ROCPPUnc_Ptr unc) const
 Calculate the coeffiecient of the given uncertain parameter. More...
 
void add_vars_involved_in_prod (dvContainer &dvs) const
 Add the variable involved in product in this expression into the given containe␐r. More...
 
void add_int_vars (dvContainer &dvs) const
 Add the integer variable in this expression into the given container. More...
 
double evaluate (const map< string, double > &valuesMap) const
 Calculate the value of this expression at the given solution. More...
 
double getSumConstantTerms () const
 Calculate the sum of the constant terms in this expression. More...
 
size_t getNumTerms () const
 Get the number of terms in this experssion. More...
 
bool hasNormTerm () const
 Returns true if and only if the expression has a norm term. More...
 
bool hasNonlinearities () const
 Returns true if and only if the expression involves nonlinear terms (i.e., terms involving products of decision variables) More...
 
bool hasProdsUncertainties () const
 Returns true if and only if the expression involves products of uncertain parameters. More...
 
bool hasProdsContVars () const
 Returns true if and only if the expression involves products of real-valued decision variables. More...
 
bool isDeterministic () const
 Returns true if and only if the expression does not involve any uncertain parameters. More...
 
bool isConstant () const
 Returns true if and only if the expression involves only constant terms. More...
 
bool isLinear () const
 Returns true if and only if the expression is linear. More...
 
bool isQuadratic () const
 Returns true if and only if the expression is quadratic. More...
 
bool isWellDefined () const
 Return true if and only if this expression is not empty. More...
 
ROCPPExpr_Ptr getLinearPart () const
 Return the part without norm term (i.e., the sum of all product terms) in this expression. More...
 
ROCPPNormTerm_Ptr getNormTerm () const
 Return the norm term in this expression. More...
 
uint getNumContVars () const
 Get the number of real-valued decision variables in the expression. More...
 
uint getNumIntVars () const
 Get the number of integer-valued decision variables in the expression. More...
 
uint getNumBoolVars () const
 Get the number of boolean decision variables in the expression. More...
 
uint getNumAdaptiveContVars () const
 Get the number of adaptive real-valued decision variables in the expression. More...
 
uint getNumAdaptiveVars () const
 Get the number of adaptive decision variables in the expression. More...
 
size_t getNumVars () const
 Get the number of decision variables in the expression. More...
 
uint getTimeStage () const
 Get the maximum time-stage of any decision variable in the expression. More...
 
size_t getNumUncertainties () const
 Get the number of uncertain parameters in the expression. More...
 
ROCPPExpr_Ptr getDeterministicLinearPart () const
 Return the sum of all deterministic product terms in this expression. More...
 
uint getNumTimesTermAppears (const multimap< string, ROCPPVarIF_Ptr > &term) const
 Get the number of times the given term appears in this expression. More...
 
void getAllProductsOf2Variables (map< pair< string, string >, uint > &freqMap, map< pair< string, string >, multimap< string, ROCPPVarIF_Ptr > > &termMap) const
 Get products of any two variables in this expression. More...
 
ROCPPconstdvContainer_Ptr getDVContainer () const
 Get the decision variable container. More...
 
ROCPPconstuncContainer_Ptr getUncContainer () const
 Get the uncertain parameter container. More...
 
ROCPPVarIF_Ptr getVar (string varName) const
 Get the variable by name. More...
 
bool varIsInvolved (ROCPPVarIF_Ptr dv) const
 Check whether the given variable is involved in this expression Call dvContainer::varIsInvolved() for the dvContainer of this expression. More...
 
bool AnyVarIsInvolved (dvContainer &dvs) const
 Check whether any decision variable in the given container is involved in this expression Call dvContainer::AnyVarIsInvolved() for the dvContainer of this expression. More...
 
ROCPPExpr_Ptr Clone () const
 Clone this expression. More...
 
void WriteToStream (ofstream &ofs) const
 Print this term to the stream ofs. More...
 

Protected Member Functions

iterator find (ROCPPCstrTermIF_Ptr term)
 Find a term in this expression. More...
 

Protected Attributes

vector< ROCPPCstrTermIF_Ptrm_terms
 Vector of terms in this expression. More...
 
bool m_hasNormTerm
 Indicates whether this expression has a norm term or not. More...
 
ROCPPdvContainer_Ptr m_pDVContainer
 Decision variable container for this expression. More...
 
ROCPPuncContainer_Ptr m_pUncContainer
 Uncertain parameter container for this expression. More...
 

Detailed Description

Left hand-side expression class.

Member Typedef Documentation

◆ const_iterator

Constant iterator in vector of constraint terms.

◆ ConstraintLHS_const_iterator

Constant iterator in vector of constraint terms.

◆ ConstraintLHS_iterator

Iterator in vector of constraint terms.

◆ dvIterator

typedef dvMapType::const_iterator LHSExpression::dvIterator

Constant iterator in decision variable map.

◆ iterator

Iterator in vector of constraint terms.

◆ uncIterator

typedef uncMapType::const_iterator LHSExpression::uncIterator

Constant iterator in uncertain parameter map.

Constructor & Destructor Documentation

◆ LHSExpression()

LHSExpression::LHSExpression ( )
inline

Constructor of LHSExpression.

◆ ~LHSExpression()

LHSExpression::~LHSExpression ( )
inline

Destructor of LHSExpression.

Member Function Documentation

◆ add() [1/12]

void LHSExpression::add ( double  c)

Create a new ProductTerm using the given input and add it to the expression.

Parameters
cconstant to add to the expression

◆ add() [2/12]

void LHSExpression::add ( double  c,
ROCPPconstCstrTermIF_Ptr  term 
)

Add the product of the given inputs into the expression.

Parameters
ccoefficient
termterm to add to expression after multiplying it by coefficient
Note
Call LHExpression::add(ROCPPconstCstrTermIF_Ptr) after multiplying term by c

◆ add() [3/12]

void LHSExpression::add ( double  c,
ROCPPconstExpr_Ptr  expr 
)

Add the given expression multiplied by c to this expression.

Parameters
ccoefficient
exprexpression to add to this expression after multiplying it by coefficient c
Note
Call LHExpression::add(ROCPPconstExpr_Ptr) after scaled

◆ add() [4/12]

void LHSExpression::add ( double  c,
ROCPPconstExpr_Ptr  pExpression,
ROCPPUnc_Ptr  pUnc 
)

Add the product of the given inputs to the expression.

Parameters
ccoefficient
pUncuncertain parameter
pExpressionexpression to add to this expression after multiplying it by coefficient c and by uncertain parameter pUnc Call LHExpression::add(ROCPPconstExpr_Ptr)

◆ add() [5/12]

void LHSExpression::add ( double  c,
ROCPPconstExpr_Ptr  pExpression,
ROCPPVarIF_Ptr  pVariable 
)

Add the product of the given inputs to the expression.

Parameters
ccoefficient
pVariabledecision variable
pExpressionexpression to add to this expression after multiplying it by coefficient c and by decision variable pVariable
Note
Call LHExpression::add(ROCPPconstExpr_Ptr)

◆ add() [6/12]

void LHSExpression::add ( double  c,
ROCPPUnc_Ptr  pUncertainty 
)

Create a new ProductTerm using the given inputs and add it to the expression.

Parameters
ccoefficient of the term to add
pUncertaintyuncertain parameter of the term to add

◆ add() [7/12]

void LHSExpression::add ( double  c,
ROCPPUnc_Ptr  pUncertainty,
ROCPPVarIF_Ptr  pVariable 
)

Create a new ProductTerm using the given inputs and add it to the expression.

Parameters
ccoefficient of the term to add
pUncertaintyuncertain parameter of the term to add
pVariabledecision variable of the term to add

◆ add() [8/12]

void LHSExpression::add ( double  c,
ROCPPUnc_Ptr  pUncertainty,
ROCPPVarIF_Ptr  pVariable1,
ROCPPVarIF_Ptr  pVariable2 
)

Create a new ProductTerm using the given inputs and add it to the expression.

Parameters
ccoefficient of the term to add
pUncertaintyuncertain parameter of the term to add
pVariable1first decision variable of the term to add
pVariable2second decision variable of the term to add

◆ add() [9/12]

void LHSExpression::add ( double  c,
ROCPPVarIF_Ptr  pVariable 
)

Create a new ProductTerm using the given inputs and add it to the expression.

Parameters
ccoefficient of the term to add
pVariabledecision variable of the term to add

◆ add() [10/12]

void LHSExpression::add ( double  c,
ROCPPVarIF_Ptr  pVariable1,
ROCPPVarIF_Ptr  pVariable2 
)

Create a new ProductTerm using the given inputs and add it to the expression.

Parameters
ccoefficient of the term to add
pVariable1first decision variable of the term to add
pVariable2second decision variable of the term to add

◆ add() [11/12]

void LHSExpression::add ( ROCPPconstCstrTermIF_Ptr  term)

Add the given term to the expression.

Note
If the term already exists, change the coefficient
Warning
One expression can only have one norm term with coefficient equal to 1

◆ add() [12/12]

void LHSExpression::add ( ROCPPconstExpr_Ptr  expr)

Add the given expression to this expression.

Parameters
exprexpression to add to this expression
Note
Call LHExpression::add(ROCPPconstCstrTermIF_Ptr) for every term in this expression

◆ add_int_vars()

void LHSExpression::add_int_vars ( dvContainer dvs) const

Add the integer variable in this expression into the given container.

Note
Call ConstraintTermIF::add_int_vars() based on the type for each term in this expression

◆ add_vars_involved_in_prod()

void LHSExpression::add_vars_involved_in_prod ( dvContainer dvs) const

Add the variable involved in product in this expression into the given containe␐r.

Note
Call ConstraintTermIF::add_vars_involved_in_prod() based on the type for each term in this expression

◆ AnyVarIsInvolved()

bool LHSExpression::AnyVarIsInvolved ( dvContainer dvs) const

Check whether any decision variable in the given container is involved in this expression Call dvContainer::AnyVarIsInvolved() for the dvContainer of this expression.

◆ begin()

const_iterator LHSExpression::begin ( ) const
inline

Return a constant iterator pointing to the beginning of m_terms in the expression.

◆ Clone()

ROCPPExpr_Ptr LHSExpression::Clone ( ) const

Clone this expression.

◆ end()

const_iterator LHSExpression::end ( ) const
inline

Return a constant iterator pointing to the end of m_terms in the expression.

◆ evaluate()

double LHSExpression::evaluate ( const map< string, double > &  valuesMap) const

Calculate the value of this expression at the given solution.

Note
Call ConstraintTermIF::evaluate() based on the type for each term in this expression

◆ factorOut()

pair< bool, ROCPPExpr_Ptr > LHSExpression::factorOut ( ROCPPUnc_Ptr  unc) const

Calculate the coeffiecient of the given uncertain parameter.

Note
Call ProductTerm::factorOut for every ProductTerm in this expression

◆ find() [1/2]

LHSExpression::const_iterator LHSExpression::find ( ROCPPconstCstrTermIF_Ptr  term) const

Find a term in the expression.

Parameters
termterm to add to the expression

◆ find() [2/2]

LHSExpression::iterator LHSExpression::find ( ROCPPCstrTermIF_Ptr  term)
protected

Find a term in this expression.

◆ getAllProductsOf2Variables()

void LHSExpression::getAllProductsOf2Variables ( map< pair< string, string >, uint > &  freqMap,
map< pair< string, string >, multimap< string, ROCPPVarIF_Ptr > > &  termMap 
) const

Get products of any two variables in this expression.

Parameters
freqMapmap from the pair of the decision variable names in each product to the frequency of this product
termMapmap from the pair of the decision variable names in each product to the map of the name to the variable involved in the product
Note
The calculated results are stored in the two inputs of this method

◆ getDeterministicLinearPart()

ROCPPExpr_Ptr LHSExpression::getDeterministicLinearPart ( ) const

Return the sum of all deterministic product terms in this expression.

◆ getDVContainer()

ROCPPconstdvContainer_Ptr LHSExpression::getDVContainer ( ) const

Get the decision variable container.

◆ getLinearPart()

ROCPPExpr_Ptr LHSExpression::getLinearPart ( ) const

Return the part without norm term (i.e., the sum of all product terms) in this expression.

◆ getNormTerm()

ROCPPNormTerm_Ptr LHSExpression::getNormTerm ( ) const

Return the norm term in this expression.

◆ getNumAdaptiveContVars()

uint LHSExpression::getNumAdaptiveContVars ( ) const
inline

Get the number of adaptive real-valued decision variables in the expression.

◆ getNumAdaptiveVars()

uint LHSExpression::getNumAdaptiveVars ( ) const
inline

Get the number of adaptive decision variables in the expression.

◆ getNumBoolVars()

uint LHSExpression::getNumBoolVars ( ) const
inline

Get the number of boolean decision variables in the expression.

◆ getNumContVars()

uint LHSExpression::getNumContVars ( ) const
inline

Get the number of real-valued decision variables in the expression.

◆ getNumIntVars()

uint LHSExpression::getNumIntVars ( ) const
inline

Get the number of integer-valued decision variables in the expression.

◆ getNumTerms()

size_t LHSExpression::getNumTerms ( ) const
inline

Get the number of terms in this experssion.

◆ getNumTimesTermAppears()

uint LHSExpression::getNumTimesTermAppears ( const multimap< string, ROCPPVarIF_Ptr > &  term) const

Get the number of times the given term appears in this expression.

Note
Call ProductTerm::getNumTimesTermAppears() or NormTerm::getNumTimesTermAppears() based on the type for each term in this expression

◆ getNumUncertainties()

size_t LHSExpression::getNumUncertainties ( ) const
inline

Get the number of uncertain parameters in the expression.

◆ getNumVars()

size_t LHSExpression::getNumVars ( ) const
inline

Get the number of decision variables in the expression.

◆ getSumConstantTerms()

double LHSExpression::getSumConstantTerms ( ) const

Calculate the sum of the constant terms in this expression.

◆ getTimeStage()

uint LHSExpression::getTimeStage ( ) const
inline

Get the maximum time-stage of any decision variable in the expression.

◆ getUncContainer()

ROCPPconstuncContainer_Ptr LHSExpression::getUncContainer ( ) const

Get the uncertain parameter container.

◆ getVar()

ROCPPVarIF_Ptr LHSExpression::getVar ( string  varName) const

Get the variable by name.

◆ hasNonlinearities()

bool LHSExpression::hasNonlinearities ( ) const

Returns true if and only if the expression involves nonlinear terms (i.e., terms involving products of decision variables)

◆ hasNormTerm()

bool LHSExpression::hasNormTerm ( ) const
inline

Returns true if and only if the expression has a norm term.

◆ hasProdsContVars()

bool LHSExpression::hasProdsContVars ( ) const

Returns true if and only if the expression involves products of real-valued decision variables.

◆ hasProdsUncertainties()

bool LHSExpression::hasProdsUncertainties ( ) const

Returns true if and only if the expression involves products of uncertain parameters.

◆ isConstant()

bool LHSExpression::isConstant ( ) const

Returns true if and only if the expression involves only constant terms.

◆ isDeterministic()

bool LHSExpression::isDeterministic ( ) const

Returns true if and only if the expression does not involve any uncertain parameters.

◆ isLinear()

bool LHSExpression::isLinear ( ) const

Returns true if and only if the expression is linear.

◆ isQuadratic()

bool LHSExpression::isQuadratic ( ) const

Returns true if and only if the expression is quadratic.

◆ isWellDefined()

bool LHSExpression::isWellDefined ( ) const
inline

Return true if and only if this expression is not empty.

◆ mapExprUnc()

ROCPPExpr_Ptr LHSExpression::mapExprUnc ( const map< string, ROCPPUnc_Ptr > &  mapFromOldToNewUnc) const

Map the old uncertain parameters in this expression to new uncertain parameters.

Note
Call ProductTerm::mapTermsUnc() or NormTerm::mapTermsUnc() for every term based on its type in this expression

◆ mapExprVars()

ROCPPExpr_Ptr LHSExpression::mapExprVars ( const map< string, ROCPPVarIF_Ptr > &  mapFromOldToNewVars) const

Map the old decision variables in this expression to new decision variables.

Note
Call ProductTerm::mapTermsVars() or NormTerm::mapTermsVars() for every term based on its type in this expression

◆ mapUncs()

ROCPPExpr_Ptr LHSExpression::mapUncs ( const map< string, ROCPPExpr_Ptr > &  mapFromUncToExpression) const

Map the old uncertain parameters in this expression to some expressions.

Note
Call ProductTerm::mapUnc() or NormTerm::mapUnc() for every term based on its type in this expression

◆ mapVars()

ROCPPExpr_Ptr LHSExpression::mapVars ( const map< string, ROCPPExpr_Ptr > &  mapFromVarToExpression) const

Map the old variables in this expression to some expressions.

Note
Call ProductTerm::mapVars() or NormTerm::mapVars() for every term based on its type in this expression

◆ operator*=() [1/5]

void LHSExpression::operator*= ( double  a)

Multiply expression by given constant.

Parameters
aconstant to multiply this expression by

◆ operator*=() [2/5]

void LHSExpression::operator*= ( ROCPPconstCstrTermIF_Ptr  term)

Multiply expression by given term.

Parameters
termterm to multiply this expression by

◆ operator*=() [3/5]

void LHSExpression::operator*= ( ROCPPconstExpr_Ptr  other)

Multiply expression by given expression.

Parameters
otherexpression to multiply this expression by

◆ operator*=() [4/5]

void LHSExpression::operator*= ( ROCPPUnc_Ptr  unc)

Multiply expression by given uncertain parameter.

Parameters
uncuncertain parameter to multiply this expression by

◆ operator*=() [5/5]

void LHSExpression::operator*= ( ROCPPVarIF_Ptr  var)

Multiply expression by given decision variable.

Parameters
vardecision variable to multiply this expression by

◆ operator+=() [1/5]

void LHSExpression::operator+= ( double  a)
inline

Add constant to expression.

Parameters
aconstants to add to this expression

◆ operator+=() [2/5]

void LHSExpression::operator+= ( ROCPPconstCstrTermIF_Ptr  term)
inline

Add term to expression.

Parameters
termterm to add to this expression

◆ operator+=() [3/5]

void LHSExpression::operator+= ( ROCPPconstExpr_Ptr  other)
inline

Add expression to expression.

Parameters
otherexpression to add to this expression

◆ operator+=() [4/5]

void LHSExpression::operator+= ( ROCPPUnc_Ptr  unc)
inline

Add uncertain parameter to expression.

Parameters
uncuncertain parameter to add to this expression

◆ operator+=() [5/5]

void LHSExpression::operator+= ( ROCPPVarIF_Ptr  var)
inline

Add decision variable to expression.

Parameters
vardecision variable to add to this expression

◆ replaceBilinearTerm()

ROCPPExpr_Ptr LHSExpression::replaceBilinearTerm ( map< pair< string, string >, ROCPPVarIF_Ptr > &  allTerms,
uint count 
) const

Replace the bilinear term in this object with the given decision variable.

Parameters
allTermsmap from pair of decision variable names that define the bilinear term to the decision variable used to replace the term
countnumber of different bilinear terms
Note
The function will search and replace all the bilinear terms in this expression and store the information in the two input parameters
If the same bilinear term appears later, it will be replaced by the same variable
The time stage of the new variable is decided by the maximum time-stage of the decision variables in the bilinear term
Warning
The bilinear term should include at least one boolean varaible

◆ replaceTermWithVar()

ROCPPExpr_Ptr LHSExpression::replaceTermWithVar ( const multimap< string, ROCPPVarIF_Ptr > &  term,
ROCPPVarIF_Ptr  var 
) const

Replace the given term in this expression with the given decision variable.

Note
Call ProductTerm::replaceTermWithVar() or NormTerm::replaceTermWithVar() for every term based on its type in this expression

◆ uncBegin()

uncIterator LHSExpression::uncBegin ( ) const
inline

Return a constaint iterator pointing to the beginning of the uncertain parameter container (m_pUncContainer)

◆ uncEnd()

uncIterator LHSExpression::uncEnd ( ) const
inline

Return a constant iterator pointing to the end of the uncertain parameter container (m_pUncContainer)

◆ varIsInvolved()

bool LHSExpression::varIsInvolved ( ROCPPVarIF_Ptr  dv) const

Check whether the given variable is involved in this expression Call dvContainer::varIsInvolved() for the dvContainer of this expression.

◆ varsBegin()

dvIterator LHSExpression::varsBegin ( ) const
inline

Return a constant iterator pointing to the beginning of the decision variable container (m_pDVContainer)

◆ varsEnd()

dvIterator LHSExpression::varsEnd ( ) const
inline

Return a constant iterator pointing to the end of the decision variable container m_pDVContainer.

◆ WriteToStream()

void LHSExpression::WriteToStream ( ofstream &  ofs) const

Print this term to the stream ofs.

Parameters
ofsoutput file stream

Member Data Documentation

◆ m_hasNormTerm

bool LHSExpression::m_hasNormTerm
protected

Indicates whether this expression has a norm term or not.

◆ m_pDVContainer

ROCPPdvContainer_Ptr LHSExpression::m_pDVContainer
protected

Decision variable container for this expression.

◆ m_pUncContainer

ROCPPuncContainer_Ptr LHSExpression::m_pUncContainer
protected

Uncertain parameter container for this expression.

◆ m_terms

vector<ROCPPCstrTermIF_Ptr> LHSExpression::m_terms
protected

Vector of terms in this expression.