Functions
Solver Variables

Functions

Var * mdlVar_create (double v)
 
The mdlVar_create function allocates and initializes a Var

data structure. More...

 
void mdlVar_use (Var *pThis)
 The mdlVar_use function increments the "use count" for variable this. More...
 
void mdlVar_destroy (Var *pThis)
 
The mdlVar_destroy function decrements the "use count"

for variable this and, if the use count becomes zero, frees the variable's storage. More...

 
Var * mdlVar_setVal (Var *pThis, double v)
 
The mdlVar_setVal function sets the current value of

Var this to value. More...

 
double mdlVar_getVal (Var *pThis)
 
The mdlVar_getVal function returns the current value of

Var this. More...

 
bool mdlVar_hasNoValue (Var *pThis)
 
The mdlVar_hasNoValue function queries if the value of

this has not been set yet (or has been set the to special value NA). More...

 
void mdlVar_saveVal (Var *pThis)
 
The mdlVar_saveVal function saves the current value of

Var this as its "old" value. More...

 
void mdlVar_restoreVal (Var *pThis)
 mdlVar_restoreVal sets the current value of this to its old value. More...
 
int mdlVar_isUnderDetermined (Var *pThis)
 
The mdlVar_isUnderDetermined function queries the

"under-determined" attribute of Var this. More...

 
void mdlVar_setUnderDetermined (Var *pThis, int isUnderDetermined)
 
The mdlVar_setUnderDetermined function sets the

"under-determined" attribute of Var this to the value isUnderDetermined. More...

 
bool mdlVar_isChanged (Var *pThis, double epsilon)
 
The mdlVar_isChanged function tests if the current value

of Var this is different from its "old" value by at least tolerance. More...

 
bool mdlVar_isConstant (Var *pThis)
 
The mdlVar_isConstant function queries if the variable is

to be treated as a constant. More...

 
void mdlVar_setConstant (Var *pThis, bool isConstant)
 
The mdlVar_setConstant function sets the value or

the variable and optionally marks it as a "constant". More...

 

Detailed Description

Function Documentation

Var* mdlVar_create ( double  v)

The mdlVar_create function allocates and initializes a Var

data structure.

Parameters
[in]vspecifies the variable's initial value. Passing the constant NA signifies that the variable has no value (yet).
Returns
mdlVar_create returns a pointer to the Var's storage, or NULL if insufficient memory is available.
See also
mdlVar_destroy
Remarks
Required Library: mdlbltin.lib
void mdlVar_destroy ( Var *  pThis)

The mdlVar_destroy function decrements the "use count"

for variable this and, if the use count becomes zero, frees the variable's storage.

Parameters
[in,out]pThisuse count decremented, freed?
Returns
mdlVar_destroy is of type void.
See also
mdlVar_use
Remarks
Required Library: mdlbltin.lib
double mdlVar_getVal ( Var *  pThis)

The mdlVar_getVal function returns the current value of

Var this.

If this has no value, then the special value NA is returned.

Parameters
[in,out]pThisvariable to query
Returns
mdlVar_getVal returns the current value of this.
See also
mdlVar_setVal mdlVar_saveVal mdlVar_restoreVal mdlVar_hasNoValue
Remarks
Required Library: mdlbltin.lib
bool mdlVar_hasNoValue ( Var *  pThis)

The mdlVar_hasNoValue function queries if the value of

this has not been set yet (or has been set the to special value NA).

Parameters
[in,out]pThisvariable to query
Returns
mdlVar_hasNoValue returns true if the value of the variable is NA; else false.
See also
mdlVar_setVal mdlVar_getVal
Remarks
Required Library: mdlbltin.lib
bool mdlVar_isChanged ( Var *  pThis,
double  epsilon 
)

The mdlVar_isChanged function tests if the current value

of Var this is different from its "old" value by at least tolerance.

Parameters
[in]pThisvariable to query
[in]epsilonthreshold
Returns
mdlVar_isChanged returns true if the variable's current value is significantly different from its old value; false, otherwise.
See also
mdlVar_saveVal mdlVar_restoreVal
Remarks
Required Library: mdlbltin.lib
bool mdlVar_isConstant ( Var *  pThis)

The mdlVar_isConstant function queries if the variable is

to be treated as a constant.

Parameters
[in]pThisthe variable to query
Returns
mdlVar_isConstant returns true if the variable is marked constant; false, otherwise.
See also
mdlVar_setConstant
Remarks
Required Library: mdlbltin.lib
int mdlVar_isUnderDetermined ( Var *  pThis)

The mdlVar_isUnderDetermined function queries the

"under-determined" attribute of Var this.

Parameters
[in]pThisvariable to query
Returns
mdlVar_isUnderDetermined returns true if the Var is marked under-determined; false, otherwise.
See also
mdlVar_setUnderDetermined
Remarks
Required Library: mdlbltin.lib
void mdlVar_restoreVal ( Var *  pThis)

mdlVar_restoreVal sets the current value of this to its old value.

Parameters
[in,out]pThisvariable to link to
Returns
mdlVar_restoreVal is of type void.
See also
mdlVar_saveVal
Remarks
Required Library: mdlbltin.lib
void mdlVar_saveVal ( Var *  pThis)

The mdlVar_saveVal function saves the current value of

Var this as its "old" value.

Parameters
[in,out]pThisvariable to update
Returns
mdlVar_saveVal is of type void.
See also
mdlVar_restoreVal
Remarks
Required Library: mdlbltin.lib
void mdlVar_setConstant ( Var *  pThis,
bool  isConstant 
)

The mdlVar_setConstant function sets the value or

the variable and optionally marks it as a "constant".

Parameters
[in,out]pThisvariable to modify
[in]isConstantif true, the variable becomes a constant; else the variable is marked as changeable.
Returns
mdlVar_setConstant is of type void.
See also
mdlVar_isConstant
Remarks
Required Library: mdlbltin.lib
void mdlVar_setUnderDetermined ( Var *  pThis,
int  isUnderDetermined 
)

The mdlVar_setUnderDetermined function sets the

"under-determined" attribute of Var this to the value isUnderDetermined.

Parameters
[in,out]pThisvariable to modify
[in]isUnderDeterminedvalue of under-determined attr
Returns
mdlVar_setUnderDetermined is of type void.
See also
mdlVar_isUnderDetermined
Remarks
Required Library: mdlbltin.lib
Var* mdlVar_setVal ( Var *  pThis,
double  v 
)

The mdlVar_setVal function sets the current value of

Var this to value.

Parameters
[in,out]pThisvariable to update
[in]vnew value
Returns
mdlVar_setVal returns this.
See also
mdlVar_getVal mdlVar_saveVal mdlVar_restoreVal
Remarks
Required Library: mdlbltin.lib
void mdlVar_use ( Var *  pThis)

The mdlVar_use function increments the "use count" for variable this.

Parameters
[in,out]pThisuse count incremented
Returns
mdlVar_use is of type void.
See also
mdlVar_destroy
Remarks
Required Library: mdlbltin.lib

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.