public interface IloNumToNumStepFunction
An instance of IloNumToNumStepFunction represents a step function that is defined everywhere on an
interval [xMin, xMax). Each interval [x1, x2) on which the
function has the same value is called a step.
Note that if n is the number of steps of the function, the random access to a given step (see the member
function setValue) has a worst-case complexity in O(log(n)).
Furthermore, when two consecutive steps of the function have the same value, these steps are merged so that the function is always represented with the minimal number of steps.
| Modifier and Type | Method and Description |
|---|---|
void |
add(IloNumToNumStepFunction fct)
This operator adds the argument function
fct to the invoking
step function. |
void |
addValue(double x1,
double x2,
double v)
This member function adds
v to the value of the invoking
step function everywhere on the interval [x1, x2). |
IloNumToNumStepFunction |
copy()
This member function creates and returns a new function that is
a copy of the invoking function.
|
void |
dilate(double k)
This member function multiplies by
k the scale of x for the invoking step
function. |
double |
getArea(double x1,
double x2)
This member function returns the sum of the invoking step function on the
interval
[x1, x2). |
double |
getDefinitionIntervalMax()
This member function returns the right-most point of the definition
interval of the invoking step function.
|
double |
getDefinitionIntervalMin()
This member function returns the left-most point of the definition
interval of the invoking step function.
|
double |
getMax(double x1,
double x2)
This member function returns the maximal value of the invoking step
function on the interval
[x1, x2). |
double |
getMin(double x1,
double x2)
This member function returns the minimal value of the invoking step
function on the interval
[x1, x2). |
double |
getValue(double x)
This member function returns the value of the invoking step function at
x. |
void |
prod(double k)
This operator multiplies by a factor
k the value of the
invoking step function everywhere on the definition interval. |
void |
setMax(double x1,
double x2,
double v)
This member function sets the value of the invoking step function to be
the maximum between the current value and
v everywhere on the
interval [x1, x2). |
void |
setMax(IloNumToNumStepFunction fct)
This member function sets the value of the invoking step function to be
the maximum between the current value and the value of
fct
everywhere on the definition interval of the invoking function. |
void |
setMin(double x1,
double x2,
double v)
This member function sets the value of the invoking step function to be
the minimum between the current value and
v everywhere on the
interval [x1, x2). |
void |
setMin(IloNumToNumStepFunction fct)
This member function sets the value of the invoking step function to be
the minimum between the current value and the value of
fct
everywhere on the definition interval of the invoking function. |
void |
setPeriodic(IloNumToNumStepFunction f,
double x0)
This member function initializes the invoking function as a step
function that repeats the step function
f after x0
until the end of the definition interval of the invoking function. |
void |
setPeriodic(IloNumToNumStepFunction f,
double x0,
double n)
This member function initializes the invoking function as a
step function that repeats the step function
f,
n times after x0. |
void |
setPeriodic(IloNumToNumStepFunction f,
double x0,
double n,
double dval)
This member function initializes the invoking function as a step function
that repeats the step function
f, n times after
x0. |
void |
setPeriodicValue(double x1,
double x2,
IloNumToNumStepFunction f)
This member function changes the value of the invoking function
on the interval
[x1,x2). |
void |
setPeriodicValue(double x1,
double x2,
IloNumToNumStepFunction f,
double offset)
This member function changes the value of the invoking function
on the interval
[x1,x2). |
void |
setSteps(ilog.concert.IloNumArray x,
ilog.concert.IloNumArray v)
This member function initializes the invoking function as a step function
whose steps are defined by the two arguments arrays
x and
v. |
void |
setValue(double x1,
double x2,
double v)
This member function sets the value of the invoking step function to be
v on the interval
[x1, x2). |
void |
shift(double dx)
This member function shifts the invoking function from
dx to
the right if dx > 0 or from -dx to the left if
dx < 0. |
void |
shift(double dx,
double dval)
This member function shifts the invoking function from
dx to
the right if dx > 0 or from -dx to the left if
dx < 0. |
void |
sub(IloNumToNumStepFunction fct)
This operator subtracts the argument function
fct from the
invoking step function. |
IloNumToNumStepFunction copy()
This member function creates and returns a new function that is a copy of the invoking function.
void setValue(double x1,
double x2,
double v)
This member function sets the value of the invoking step function to be v on the interval
[x1, x2).
void addValue(double x1,
double x2,
double v)
This member function adds v to the value of the invoking
step function everywhere on the interval [x1, x2).
void setMax(double x1,
double x2,
double v)
This member function sets the value of the invoking step function to be
the maximum between the current value and v everywhere on the
interval [x1, x2).
void setMin(double x1,
double x2,
double v)
This member function sets the value of the invoking step function to be
the minimum between the current value and v everywhere on the
interval [x1, x2).
void shift(double dx)
This member function shifts the invoking function from dx to
the right if dx > 0 or from -dx to the left if
dx < 0. It has no effect if dx = 0. More
precisely, if the invoking function is defined on [xMin,xMax)
and dx > 0, the new value of the invoking function is:
dval on the interval [xMin, xMin+dx),x in [xMin+dx, xMax), the former value
at x-dx. If dx < 0, the new value of the invoking function
is:
x in [xMin, xMax+dx), the former value
at x-dx,dval on the interval [xMax+dx,xMax).void shift(double dx,
double dval)
This member function shifts the invoking function from dx to
the right if dx > 0 or from -dx to the left if
dx < 0. It has no effect if dx = 0. More
precisely, if the invoking function is defined on [xMin,xMax)
and dx > 0, the new value of the invoking function is:
dval on the interval [xMin, xMin+dx),x in [xMin+dx, xMax), the former value
at x-dx. If dx < 0, the new value of the invoking function
is:
x in [xMin, xMax+dx), the former value
at x-dx,dval on the interval [xMax+dx,xMax).double getDefinitionIntervalMin()
This member function returns the left-most point of the definition interval of the invoking step function.
double getDefinitionIntervalMax()
This member function returns the right-most point of the definition interval of the invoking step function.
double getValue(double x)
This member function returns the value of the invoking step function at
x. An instance of IloException is thrown if
x does not belong to the definition interval of the invoking
function.
double getMax(double x1,
double x2)
This member function returns the maximal value of the invoking step
function on the interval [x1, x2). An instance of
IloException is thrown if the interval [x1, x2) is
not included in the definition interval of the invoking function.
double getMin(double x1,
double x2)
This member function returns the minimal value of the invoking step
function on the interval [x1, x2). An instance of
IloException is thrown if the interval [x1, x2) is
not included in the definition interval of the invoking function.
double getArea(double x1,
double x2)
This member function returns the sum of the invoking step function on the
interval [x1, x2). An instance of IloException is
thrown if the interval [x1, x2) is not included in the
definition interval of the invoking function.
void prod(double k)
This operator multiplies by a factor k the value of the
invoking step function everywhere on the definition interval.
void add(IloNumToNumStepFunction fct)
This operator adds the argument function fct to the invoking
step function.
void dilate(double k)
This member function multiplies by k the scale of x for the invoking step
function. k must be a nonnegative numeric value. More precisely, if the invoking function was
defined over an interval [xMin, xMax), it will be redefined over the interval [k*xMin,
k*xMax) and the value at x will be the former value at x/k.
void setSteps(ilog.concert.IloNumArray x,
ilog.concert.IloNumArray v)
This member function initializes the invoking function as a step function
whose steps are defined by the two arguments arrays x and
v. More precisely, if n is the size of array
x, size of array v must be n+1 and,
if the invoking function is defined on the interval
[xMin,xMax), its values will be:
v[0] on interval [xMin,x[0]),v[i] on interval [x[i-1],x[i]) for all
i in [0,n-1], and v[n] on interval [x[n-1],xMax). void setPeriodic(IloNumToNumStepFunction f, double x0, double n, double dval)
This member function initializes the invoking function as a step function
that repeats the step function f, n times after
x0. More precisely, if f is defined on
[xfpMin,xfpMax) and if the invoking function is defined on
[xMin,xMax), the value of the invoking function will be:
dval on [xMin, x0), fp((x-x0+xfpMin) % (xfpMax-xfpMin)) for x in
[x0, Min(x0+n*(xfpMax-xfpMin), xMax)), anddval on [Min(x0+n*(xfpMax-xfpMin), xMax), xMax)
void setPeriodic(IloNumToNumStepFunction f, double x0, double n)
This member function initializes the invoking function as a
step function that repeats the step function f,
n times after x0. More precisely, if
f is defined on [xfpMin,xfpMax) and if the invoking
function is defined on [xMin,xMax), the value of the invoking
function will be:
[xMin, x0),fp((x-x0+xfpMin) % (xfpMax-xfpMin)) for x in
[x0, Min(x0+n*(xfpMax-xfpMin), xMax)), and[Min(x0+n*(xfpMax-xfpMin), xMax), xMax)void setPeriodic(IloNumToNumStepFunction f, double x0)
This member function initializes the invoking function as a step
function that repeats the step function f after x0
until the end of the definition interval of the invoking function. More precisely,
if f is defined on [xfpMin,xfpMax) and if the invoking
function is defined on [xMin,xMax), the value of the invoking
function will be:
[xMin, x0),fp((x-x0+xfpMin) % (xfpMax-xfpMin)) for x in
[x0, xMax)void setPeriodicValue(double x1,
double x2,
IloNumToNumStepFunction f,
double offset)
This member function changes the value of the invoking function
on the interval [x1,x2). On this interval, the
invoking function is set to equal a repetition of the pattern
function f with an initial offset of
offset. The invoking function is not modified outside
the interval [x1,x2). More precisely, if
[min,max) denotes the definition interval of
f, for all t in [x1,x2), the
invoking function at t is set to equal
f(min + (offset+t-x1)%(max-min))) where %
denotes the modulo operator. By default, the offset is equal to 0.
void setPeriodicValue(double x1,
double x2,
IloNumToNumStepFunction f)
This member function changes the value of the invoking function
on the interval [x1,x2). On this interval, the
invoking function is set to equal a repetition of the pattern
function f with an initial offset of
offset. The invoking function is not modified outside
the interval [x1,x2). More precisely, if
[min,max) denotes the definition interval of
f, for all t in [x1,x2), the
invoking function at t is set to equal
f(min + (offset+t-x1)%(max-min))) where %
denotes the modulo operator. By default, the offset is equal to 0.
void setMin(IloNumToNumStepFunction fct)
This member function sets the value of the invoking step function to be
the minimum between the current value and the value of fct
everywhere on the definition interval of the invoking function. The
definition interval of fct must be the same as the one of the
invoking step function.
void setMax(IloNumToNumStepFunction fct)
This member function sets the value of the invoking step function to be
the maximum between the current value and the value of fct
everywhere on the definition interval of the invoking function. The interval
of definition of fct must be the same as that of the invoking
step function.
void sub(IloNumToNumStepFunction fct)
This operator subtracts the argument function fct from the
invoking step function.