NO FRAMES

Class IloSemiContVar

Definition file: ilconcert/iloexpression.h
For ILOG CPLEX: instance represents a constrained semicontinuous variable.

An instance of this class represents a constrained semicontinuous variable in a Concert Technology model. Semicontinuous variables derive from IloNumVar, the class of numeric variables.

A semicontinuous variable may be 0 (zero) or it may take a value within an interval defined by its semicontinuous lower and upper bound. Conventionally, semicontinuous variables are defined as floating-point variables, but you can designate an instance of IloSemiContVar as integer by using the type specification it inherits from IloNumVar. In that case, Concert Technology will impose an integrality constraint on the semicontinuous variable for you, thus further restricting the feasible set of values to 0 (zero) and the integer values in the interval defined by the semicontinuous lower and upper bound.

Note
When numeric bounds are given to an integer variable (an instance of IloIntVar or IloNumVar with Type = Int) in the constructors or via a modifier (setUB, setLB, setBounds), they are inwardly rounded to an integer value. LB is rounded down and UB is rounded up.

In an instance of IloNumVar, lb denotes the lower bound of the variable, and ub denotes its upper bound. In an instance of the derived class IloSemiContVar, sclb denotes the semicontinuous lower bound.

In formal terms, if lb <= 0, then a semicontinuous variable is a numeric variable with the feasible set of {0, [sclb, ub]}, where 0 < sclb < ub; otherwise, for other values of lb, the feasible set of a semicontinuous variable is the intersection of the interval [lb, ub] with the set {0, [sclb, ub]}. The semicontinuous lower bound sclb may differ from the lower bound of an ordinary numeric variable in that the semicontinuous variable is restricted to the semicontinuous region. For example, the table below shows you the bounds of a semicontinuous variable and the corresponding feasible region.

Examples of bounds on semicontinuous variables and their feasible regions

These conditions define these feasible regions
lb == ub < sclb{0} if lb==ub==0 or empty set if lb==ub!=0
lb < 0 < sclb < ub{0, [sclb, ub]}
0 < lb < sclb < ub[sclb, ub]
0 < sclb < lb < ub[lb, ub]

Most member functions in this class contain assert statements. For an explanation of the macro NDEBUG (a way to turn on or turn off these assert statements), see the concept Assert and NDEBUG.

See Also:

Constructor Summary
public IloSemiContVar()
public IloSemiContVar(IloSemiContVarI * impl)
public IloSemiContVar(const IloEnv env, IloNum sclb, IloNum ub, IloNumVar::Type type=ILOFLOAT, const char * name=0)
public IloSemiContVar(const IloAddNumVar & var, IloNum sclb, IloNum ub, IloNumVar::Type type=ILOFLOAT, const char * name=0)
Method Summary
public IloSemiContVarI *getImpl() const
public IloNumgetSemiContLB() const
public voidsetSemiContLB(IloNum sclb) const
Inherited Methods from IloNumVar
getImpl, getLB, getPossibleValues, getType, getUB, setBounds, setLB, setPossibleValues, setUB
Inherited Methods from IloNumExprArg
getImpl
Inherited Methods from IloExtractable
asConstraint, asIntExpr, asModel, asNumExpr, asObjective, asVariable, end, getEnv, getId, getImpl, getName, getObject, isConstraint, isIntExpr, isModel, isNumExpr, isObjective, isVariable, setName, setObject
Constructor Detail

IloSemiContVar

public IloSemiContVar()
This constructor creates an empty handle. You must initialize it before you use it.

IloSemiContVar

public IloSemiContVar(IloSemiContVarI * impl)
This constructor creates a handle object from a pointer to an implementation object.

IloSemiContVar

public IloSemiContVar(const IloEnv env, IloNum sclb, IloNum ub, IloNumVar::Type type=ILOFLOAT, const char * name=0)

This constructor creates an instance of IloSemiContVar from its sclb (that is, its semicontinuous lower bound) and its upper bound ub. By default, its type is floating-point, but you can use ILOINT to specify integer; in that case, Concert Technology will impose an integrality constraint on the variable. The value for lb is set to zero.


IloSemiContVar

public IloSemiContVar(const IloAddNumVar & var, IloNum sclb, IloNum ub, IloNumVar::Type type=ILOFLOAT, const char * name=0)

This constructor creates an instance of IloSemiContVar from the prototype var.


Method Detail

getImpl

public IloSemiContVarI * getImpl() const
This member function returns a pointer to the implementation object of the invoking handle.

getSemiContLB

public IloNum getSemiContLB() const

This member function returns the semicontinuous lower bound (that is, its sclb) of the invoking semicontinuous variable.


setSemiContLB

public void setSemiContLB(IloNum sclb) const

This member function makes sclb the semicontinuous lower bound of the invoking semicontinuous variable.

Note
The member function setSemiContinuousLb notifies Concert Technology algorithms about this change of this invoking object.