public interface IloNumToNumSegmentFunction
An instance of IloNumToNumSegmentFunction represents a piecewise linear function that is defined
everywhere on an interval [xMin, xMax). Each interval [x1, x2) on which the function is linear is
called a segment.
Furthermore, when two consecutive segments of the function are co-linear, these segments are merged so that the function is always represented with the minimal number of segments.
| Modifier and Type | Method and Description |
|---|---|
void |
add(IloNumToNumSegmentFunction fct)
This operator adds the argument function
fct to the invoking
piecewise linear function. |
void |
addValue(double x1,
double x2,
double v)
This member function adds
v to the value of the invoking
piecewise linear function everywhere on the interval [x1,x2). |
IloNumToNumSegmentFunction |
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 piecewise linear function. |
double |
getArea(double x1,
double x2)
This member function returns the area of the invoking piecewise linear
function on the interval
[x1,x2). |
double |
getDefinitionIntervalMax()
This member function returns the right-most point of the definition
interval of the invoking piecewise linear function.
|
double |
getDefinitionIntervalMin()
This member function returns the left-most point of the definition
interval of the invoking piecewise linear function.
|
double |
getMax(double x1,
double x2)
This member function returns the maximal value of the invoking piecewise
linear function on the interval
[x1,x2). |
double |
getMin(double x1,
double x2)
This member function returns the minimal value of the invoking piecewise
linear function on the interval
[x1,x2). |
double |
getValue(double x)
This member function returns the value of the function at point
x. |
void |
prod(double k)
This operator multiplies by a factor
k the value of the
invoking piecewise linear function everywhere on the definition
interval. |
void |
setMax(double x1,
double x2,
double v)
This member function sets the value of the invoking piecewise linear
function to be the maximum between the current value and
v
everywhere on the interval [x1,x2). |
void |
setMax(double x1,
double v1,
double x2,
double v2)
This member function sets the value of the invoking piecewise linear
function to be the maximum between the current value and the value of the
linear function:
x --> v1 + (x-x1)*(v2-v1)/(x2-x1) everywhere on the
interval [x1, x2). |
void |
setMax(IloNumToNumSegmentFunction fct)
This member function sets the value of the invoking piecewise linear
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 piecewise linear
function to be the minimum between the current value and
v
everywhere on the interval [x1,x2). |
void |
setMin(double x1,
double v1,
double x2,
double v2)
This member function sets the value of the invoking piecewise linear
function to be the minimum between the current value and the value of the
linear function:
x --> v1 + (x-x1)*(v2-v1)/(x2-x1) everywhere on the
interval [x1,x2). |
void |
setMin(IloNumToNumSegmentFunction fct)
This member function sets the value of the invoking piecewise linear
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(IloNumToNumSegmentFunction f,
double x0,
double n,
double dval)
This member function initializes the invoking function as a piecewise
linear function that repeats the piecewise linear function
f,
n times after x0. |
void |
setPeriodicValue(double x1,
double x2,
IloNumToNumSegmentFunction f,
double offset)
This member function changes the value of the invoking function
on the interval
[x1,x2). |
void |
setPoints(ilog.concert.IloNumArray x,
ilog.concert.IloNumArray v)
This member function initializes the invoking function as a piecewise
linear function whose segments are defined by the two argument arrays
x and v. |
void |
setSlope(double x1,
double x2,
double v,
double slope)
This member function sets the value of the invoking piecewise linear function equal to
f,
associating for each x in [x1,x2) -> f(x) = v + slope * (x-x1). |
void |
setValue(double x1,
double x2,
double v)
This member function sets the value of the invoking piecewise linear function to beant and equal to
v on the interval [x1,x2). |
void |
shift(double dx,
double dval)
This member function shifts the invoking function from
dx to
the right if dx > 0 or -dx to the left if
dx < 0. |
void |
sub(IloNumToNumSegmentFunction fct)
This operator subtracts the argument function
fct from the
invoking piecewise linear function. |
void setSlope(double x1,
double x2,
double v,
double slope)
This member function sets the value of the invoking piecewise linear function equal to f,
associating for each x in [x1,x2) -> f(x) = v + slope * (x-x1).
void setValue(double x1,
double x2,
double v)
This member function sets the value of the invoking piecewise linear function to beant and equal to
v on the interval [x1,x2).
IloNumToNumSegmentFunction copy()
This member function creates and returns a new function that is a copy of the invoking function.
void setPeriodic(IloNumToNumSegmentFunction f, double x0, double n, double dval)
This member function initializes the invoking function as a piecewise
linear function that repeats the piecewise linear 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), f((x-x0+xfpMin) % (xfpMax-xfpMin)) for x in
[x0, Min(x0+n*(xfpMax-xfpMin), xMax)), and dval on [Min(x0+n*(xfpMax-xfpMin), xMax), xMax)
void setPeriodicValue(double x1,
double x2,
IloNumToNumSegmentFunction 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 setPoints(ilog.concert.IloNumArray x,
ilog.concert.IloNumArray v)
This member function initializes the invoking function as a piecewise
linear function whose segments are defined by the two argument arrays
x and v.
More precisely, the size n of array x must be
equal to the size of array v, and if the created function is
defined on the interval [xmin,xmax), its values will be:
v[0] on interval [xmin, x[0]),v[i] + (t-x[i])*(v[i+1]-v[i])/(x[i+1]-x[i]) for
t in [x[i], x[i+1]) for all i in
[0, n-2] such that x[i-1] ≠ x[i], andv[n-1] on interval [x[n-1],xmax).void addValue(double x1,
double x2,
double v)
This member function adds v to the value of the invoking
piecewise linear function everywhere on the interval [x1,x2).
void setMax(double x1,
double x2,
double v)
This member function sets the value of the invoking piecewise linear
function to be the maximum between the current value and v
everywhere on the interval [x1,x2).
void setMax(double x1,
double v1,
double x2,
double v2)
This member function sets the value of the invoking piecewise linear function to be the maximum between the current value and the value of the linear function:
x --> v1 + (x-x1)*(v2-v1)/(x2-x1) everywhere on the
interval [x1, x2).
void setMin(double x1,
double x2,
double v)
This member function sets the value of the invoking piecewise linear
function to be the minimum between the current value and v
everywhere on the interval [x1,x2).
void setMin(double x1,
double v1,
double x2,
double v2)
This member function sets the value of the invoking piecewise linear function to be the minimum between the current value and the value of the linear function:
x --> v1 + (x-x1)*(v2-v1)/(x2-x1) everywhere on the
interval [x1,x2).
void shift(double dx,
double dval)
This member function shifts the invoking function from dx to
the right if dx > 0 or -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 piecewise linear function.
double getDefinitionIntervalMax()
This member function returns the right-most point of the definition interval of the invoking piecewise linear function.
double getValue(double x)
This member function returns the value of the function at point
x.
double getMax(double x1,
double x2)
This member function returns the maximal value of the invoking piecewise
linear 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 piecewise
linear 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 area of the invoking piecewise linear
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 piecewise linear function everywhere on the definition
interval.
void add(IloNumToNumSegmentFunction fct)
This operator adds the argument function fct to the invoking
piecewise linear function.
void sub(IloNumToNumSegmentFunction fct)
This operator subtracts the argument function fct from the
invoking piecewise linear function.
void setMin(IloNumToNumSegmentFunction fct)
This member function sets the value of the invoking piecewise linear
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 piecewise linear function.
void setMax(IloNumToNumSegmentFunction fct)
This member function sets the value of the invoking piecewise linear
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 piecewise linear function.
void dilate(double k)
This member function multiplies by k the scale of
x for the invoking piecewise linear 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.