Loading...
Searching...
No Matches
gams::GAMSModifier Class Reference

#include <gamsmodifier.h>

Public Member Functions

 GAMSModifier ()
 Default constructor.
 
 GAMSModifier (const GAMSParameter &gamsPar, GAMSEnum::SymbolUpdateType updType=GAMSEnum::SymbolUpdateType::Inherit)
 
 GAMSModifier (const GAMSVariable &gamsVar, GAMSEnum::SymbolUpdateAction updAction, const GAMSParameter &dataSym, GAMSEnum::SymbolUpdateType updType=GAMSEnum::SymbolUpdateType::Inherit)
 
 GAMSModifier (const GAMSEquation &gamsEqu, GAMSEnum::SymbolUpdateAction updAction, const GAMSParameter &dataSym, GAMSEnum::SymbolUpdateType updType=GAMSEnum::SymbolUpdateType::Inherit)
 
GAMSModifieroperator= (const GAMSModifier &other)
 
bool operator!= (const GAMSModifier &other) const
 
bool operator== (const GAMSModifier &other) const
 
bool isValid () const
 
GAMSSymbol gamsSymbol ()
 
GAMSEnum::SymbolUpdateAction updAction ()
 
GAMSParameter dataSymbol ()
 
GAMSEnum::SymbolUpdateType updType ()
 
bool isParameter ()
 
bool isVariable ()
 
bool isEquation ()
 

Detailed Description

Instances of this class are input to GAMSModelInstance.instatiate(). A GAMSModifier consists either of a GAMSParameter or a triple: A GAMSVariable or GAMSEquation to be modified, the modification action (e.g. . Upper, Lower or Fixed for updating bounds of a variable, or Primal/Dual for updating the level/marginal of a variable or equation mainly used for starting non-linear models from different starting points), and a GAMSParameter that holds the data for modification. In addition the UpdateType can be defined (if ommitted the type defined in the Solve call is used).

Definition at line 47 of file gamsmodifier.h.

Constructor & Destructor Documentation

◆ GAMSModifier() [1/4]

gams::GAMSModifier::GAMSModifier ( )
inline

Default constructor.

Definition at line 51 of file gamsmodifier.h.

◆ GAMSModifier() [2/4]

gams::GAMSModifier::GAMSModifier ( const GAMSParameter gamsPar,
GAMSEnum::SymbolUpdateType  updType = GAMSEnum::SymbolUpdateType::Inherit 
)

Constructor.

Parameters
gamsParGAMSParameter in the GAMS model to be modified with data for modification.
updTypeSymbol Update Type.

◆ GAMSModifier() [3/4]

gams::GAMSModifier::GAMSModifier ( const GAMSVariable gamsVar,
GAMSEnum::SymbolUpdateAction  updAction,
const GAMSParameter dataSym,
GAMSEnum::SymbolUpdateType  updType = GAMSEnum::SymbolUpdateType::Inherit 
)

Constructor.

Parameters
gamsVarGAMSVariable in the GAMS model to be modified.
updActionModification action.
dataSymParameter containing the data for the modification.
updTypeSymbol Update Type.

◆ GAMSModifier() [4/4]

gams::GAMSModifier::GAMSModifier ( const GAMSEquation gamsEqu,
GAMSEnum::SymbolUpdateAction  updAction,
const GAMSParameter dataSym,
GAMSEnum::SymbolUpdateType  updType = GAMSEnum::SymbolUpdateType::Inherit 
)

Constructor.

Parameters
gamsEquGAMSEquation in the GAMS model to be modified.
updActionModification action.
dataSymGAMSParameter containing the data for the modification.
updTypeSymbol Update Type.

Member Function Documentation

◆ dataSymbol()

GAMSParameter gams::GAMSModifier::dataSymbol ( )

Get paramter containing the data for the modification.

Returns
Returns the GAMSParamter.

◆ gamsSymbol()

GAMSSymbol gams::GAMSModifier::gamsSymbol ( )

Get symbol of the GAMS model to be modified.

Returns
Returns the GAMSSymbol.

◆ isEquation()

bool gams::GAMSModifier::isEquation ( )

Checks if a modifier is related to a GAMSDEquation.

Returns
true if it is realted to an GAMSParameter; otherwise false.

◆ isParameter()

bool gams::GAMSModifier::isParameter ( )

Checks if a modifier is related to a GAMSParameter.

Returns
true if it is realted to an GAMSParameter; otherwise false.

◆ isValid()

bool gams::GAMSModifier::isValid ( ) const

The GAMSModifier is invalid, if it has no assignment to a GAMSSymbol.

Returns
true if the GAMModifier has been initialized; otherwise false.

◆ isVariable()

bool gams::GAMSModifier::isVariable ( )

Checks if a modifier is related to a GAMSVariable.

Returns
true if it is realted to an GAMSParameter; otherwise false.

◆ operator!=()

bool gams::GAMSModifier::operator!= ( const GAMSModifier other) const

Compares two GAMSModifier objects.

Parameters
otherAnother GAMSModifier to compare to.
Returns
Returns true if the two GAMSModifier are different; otherwise false.

◆ operator=()

GAMSModifier & gams::GAMSModifier::operator= ( const GAMSModifier other)

Assigns a GAMSModifier.

Parameters
otherAnother GAMSModifier used as data source.
Returns
Returns the assigned GAMSModifier (*this).

◆ operator==()

bool gams::GAMSModifier::operator== ( const GAMSModifier other) const

Compares two GAMSModifier objects.

Parameters
otherAnother GAMSModifier to compare to.
Returns
Returns true if the two GAMSModifier are equal; otherwise false.

◆ updAction()

GAMSEnum::SymbolUpdateAction gams::GAMSModifier::updAction ( )

Get the type of modification.

Returns
Returns the symbol update action.

◆ updType()

GAMSEnum::SymbolUpdateType gams::GAMSModifier::updType ( )

Get the symbol update type.

Returns
Returns the symbol update type.