![]() |
MAiNGO
|
Class for representing an optimization variable specified by the user. More...
#include <babOptVar.h>
Classes | |
struct | ChangedBounds |
Auxiliary struct for storing changed bounds of an optimization variable. More... | |
Public Member Functions | |
OptimizationVariable (const Bounds &variableBoundsIn, const enums::VT variableType, const unsigned branchingPriority, const std::string nameIn) | |
Constructor for the case all three optional parameters are used. More... | |
OptimizationVariable (const Bounds &variableBoundsIn, const enums::VT variableType, const unsigned branchingPriority) | |
Constructor for the case only a variable type and a branching priority is specified in addition to the bounds. The variable name is empty. More... | |
OptimizationVariable (const Bounds &variableBoundsIn, const enums::VT variableType, const std::string nameIn) | |
Constructor for the case only a variable type and a name is specified in addition to the bounds. The variable is used for branching. More... | |
OptimizationVariable (const Bounds &variableBoundsIn, const unsigned branchingPriority, const std::string nameIn) | |
Constructor for the case only a branching priority and a name is specified in addition to the bounds. The variable is assumed to be continuous. More... | |
OptimizationVariable (const Bounds &variableBoundsIn, const enums::VT variableType) | |
Constructor for the case only a variable type is specified in addition to the bounds. The variable is used for branching, and the name is empty. More... | |
OptimizationVariable (const Bounds &variableBoundsIn, const unsigned branchingPriority) | |
Constructor for the case only a branching priority is specified in addition to the bounds. The variable is thus assumed to be continuous, and the name is empty. More... | |
OptimizationVariable (const Bounds &variableBoundsIn, const std::string nameIn) | |
Constructor for the case only a name is specified in addition to the bounds. The variable is thus assumed to be continuous, and it is used for branching. More... | |
OptimizationVariable (const Bounds &variableBoundsIn) | |
Minimal constructor requiring only the required information. The variable is thus assumed to be continuous, it is used for branching, and the name is empty. More... | |
OptimizationVariable (const enums::VT variableType, const unsigned branchingPriority, const std::string nameIn) | |
Constructor for the case only a variable type, branching priority and a variable name are specified. The variable bounds are not defined. This function currently just throws an exception. More... | |
OptimizationVariable (const enums::VT variableType, const unsigned branchingPriority) | |
Constructor for the case only a variable type and branching priority are specified. The variable bounds are not defined. This function currently just throws an exception. More... | |
OptimizationVariable (const enums::VT variableType, const std::string nameIn) | |
Constructor for the case only a variable type and a variable name are specified. The variable bounds are not defined. This function currently just throws an exception. More... | |
OptimizationVariable (const unsigned branchingPriority, const std::string nameIn) | |
Constructor for the case only branching priority and a variable name arespecified. The variable bounds are not defined. This function currently just throws an exception. More... | |
OptimizationVariable (const enums::VT variableType) | |
Constructor for the case only a variable type is specified. The variable bounds are not defined. This function currently just throws an exception. More... | |
OptimizationVariable (const unsigned branchingPriority) | |
Constructor for the case only a branching priority is specified. The variable bounds are not defined. This function currently just throws an exception. More... | |
OptimizationVariable (const std::string nameIn) | |
Constructor for the case only a variable name is specified. The variable bounds are not defined. This function currently just throws an exception. More... | |
OptimizationVariable (const OptimizationVariable &variableIn) | |
Copy constructor. More... | |
double | get_lower_bound () const |
Function for querying the lower variable bound. More... | |
double | get_upper_bound () const |
Function for querying the upper variable bound. More... | |
double | get_mid () const |
Function for querying the midpoint of the variable range. More... | |
std::string | get_name () const |
Function for querying the variable name. More... | |
enums::VT | get_variable_type () const |
Function for querying the variable type. More... | |
unsigned | get_branching_priority () const |
Function for querying the branching priority. More... | |
bool | has_nonempty_host_set () const |
Function for querying whether the host set of the variable is non-empty. More... | |
Public Attributes | |
struct babBase::OptimizationVariable::ChangedBounds | changedBounds |
Private Member Functions | |
OptimizationVariable & | operator= (const OptimizationVariable &) |
void | _check_discrete_bounds () |
sanity check of user-given bounds on discrete variables More... | |
Private Attributes | |
Internal variables for storing information on the OptimizationVariable | |
double | _lowerBound |
double | _upperBound |
const enums::VT | _variableType |
const unsigned | _branchingPriority |
const std::string | _name |
bool | _feasible |
Friends | |
std::ostream & | operator<< (std::ostream &os, OptimizationVariable const &ov) |
operator << overloaded for Bounds for easier output More... | |
Class for representing an optimization variable specified by the user.
An optimization variable is characterized by an upper and lower bound, a variable type (enums::VT, optional), a branching priority (BP, optional), and a name (optional), all of which are private members. Once instantiated, it cannot be modified. Each optimization variable also contains a flag (_feasible) that indicates if the bounds are consistent (lower bound <= upper bound) and in case of integer variables, whether the interval contains an integer value
|
inline |
Constructor for the case all three optional parameters are used.
[in] | variableBoundsIn | is the Bounds object representing lower and upper bounds on the optimization variable |
[in] | variableType | is the Variable Type of this variable |
[in] | branchingPriority | is the Branching Priority of this variable |
[in] | nameIn | is the name of this variable |
|
inline |
Constructor for the case only a variable type and a branching priority is specified in addition to the bounds. The variable name is empty.
[in] | variableBoundsIn | is the Bounds object representing lower and upper bounds on the optimization variable |
[in] | variableType | is the Variable Type of this variable |
[in] | branchingPriority | is the Branching Priority of this variable |
|
inline |
Constructor for the case only a variable type and a name is specified in addition to the bounds. The variable is used for branching.
[in] | variableBoundsIn | is the Bounds object representing lower and upper bounds on the optimization variable |
[in] | variableType | is the Variable Type of this variable |
[in] | nameIn | is the name of this variable |
|
inline |
Constructor for the case only a branching priority and a name is specified in addition to the bounds. The variable is assumed to be continuous.
[in] | variableBoundsIn | is the Bounds object representing lower and upper bounds on the optimization variable |
[in] | branchingPriority | is the Branching Priority of this variable |
[in] | nameIn | is the name of this variable |
|
inline |
Constructor for the case only a variable type is specified in addition to the bounds. The variable is used for branching, and the name is empty.
[in] | variableBoundsIn | is the Bounds object representing lower and upper bounds on the optimization variable |
[in] | variableType | is the Variable Type of this variable |
|
inline |
Constructor for the case only a branching priority is specified in addition to the bounds. The variable is thus assumed to be continuous, and the name is empty.
[in] | variableBoundsIn | is the Bounds object representing lower and upper bounds on the optimization variable |
[in] | branchingPriority | is the Branching Priority of this variable |
|
inline |
Constructor for the case only a name is specified in addition to the bounds. The variable is thus assumed to be continuous, and it is used for branching.
[in] | variableBoundsIn | is the Bounds object representing lower and upper bounds on the optimization variable |
[in] | nameIn | is the name of this variable |
|
inline |
Minimal constructor requiring only the required information. The variable is thus assumed to be continuous, it is used for branching, and the name is empty.
[in] | variableBoundsIn | is the Bounds object representing lower and upper bounds on the optimization variable |
OptimizationVariable::OptimizationVariable | ( | const enums::VT | variableType, |
const unsigned | branchingPriority, | ||
const std::string | nameIn | ||
) |
Constructor for the case only a variable type, branching priority and a variable name are specified. The variable bounds are not defined. This function currently just throws an exception.
[in] | variableType | is the Variable Type of this variable |
[in] | branchingPriority | is the Branching Priority of this variable |
[in] | nameIn | is the name of this variable |
OptimizationVariable::OptimizationVariable | ( | const enums::VT | variableType, |
const unsigned | branchingPriority | ||
) |
Constructor for the case only a variable type and branching priority are specified. The variable bounds are not defined. This function currently just throws an exception.
[in] | variableType | is the Variable Type of this variable |
[in] | branchingPriority | is the Branching Priority of this variable |
OptimizationVariable::OptimizationVariable | ( | const enums::VT | variableType, |
const std::string | nameIn | ||
) |
Constructor for the case only a variable type and a variable name are specified. The variable bounds are not defined. This function currently just throws an exception.
[in] | variableType | is the Variable Type of this variable |
[in] | nameIn | is the name of this variable |
OptimizationVariable::OptimizationVariable | ( | const unsigned | branchingPriority, |
const std::string | nameIn | ||
) |
Constructor for the case only branching priority and a variable name arespecified. The variable bounds are not defined. This function currently just throws an exception.
[in] | branchingPriority | is the Branching Priority of this variable |
[in] | nameIn | is the name of this variable |
OptimizationVariable::OptimizationVariable | ( | const enums::VT | variableType | ) |
Constructor for the case only a variable type is specified. The variable bounds are not defined. This function currently just throws an exception.
[in] | variableType | is the Variable Type of this variable |
OptimizationVariable::OptimizationVariable | ( | const unsigned | branchingPriority | ) |
Constructor for the case only a branching priority is specified. The variable bounds are not defined. This function currently just throws an exception.
[in] | branchingPriority | is the Branching Priority of this variable |
OptimizationVariable::OptimizationVariable | ( | const std::string | nameIn | ) |
Constructor for the case only a variable name is specified. The variable bounds are not defined. This function currently just throws an exception.
[in] | nameIn | is the name of this variable |
|
inline |
Copy constructor.
[in] | variableIn | is the optimization variable to be copied |
|
private |
sanity check of user-given bounds on discrete variables
Rounds non-discrete bounds to discrete values and updates the private member _feasible depending on whether discrete ub < discrete lb.
|
inline |
Function for querying the branching priority.
|
inline |
Function for querying the lower variable bound.
|
inline |
Function for querying the midpoint of the variable range.
|
inline |
Function for querying the variable name.
|
inline |
Function for querying the upper variable bound.
|
inline |
Function for querying the variable type.
|
inline |
Function for querying whether the host set of the variable is non-empty.
|
private |
private declaration of copy assignment operator to prevent accidental use (standard copy would give a copy with const bounds etc)
|
friend |
operator << overloaded for Bounds for easier output
[out] | os | is the outstream to be written to |
[in] | ov | is an optimization variable to be written |
|
private |
optional: whether this variable should be branched on (default: 1)
|
private |
flag indicating whether the variable has a non-empty host set (upper bound >= lower bound; contains integer/binary values where approriate)
|
private |
lower bound on the optimization variable
|
private |
optional: name of the variable
|
private |
upper bound on the optimization variable
|
private |
optional: type of variable (default: enums::VT_CONTINUOUS)
struct babBase::OptimizationVariable::ChangedBounds babBase::OptimizationVariable::changedBounds |
object holding information on possibly changed bound of the optimization variable