Overview | Group | Tree | Graph | Index | Concepts |
An instance of IlcIntToIntStepFunction
represents a step
function over integers which is defined everywhere on an interval
[xmin,xmax)
. Each interval [x1,x2)
over which the
function has the same value is called a step. The member functions of the
class IlcIntToIntStepFunction
are not reversible.
See Also:
IlcIntToIntStepFunctionCursor, IlcMax, IlcMin, operator+, operator-, operator-, operator*, operator==, operator<=, operator>=
Constructor Summary | |
---|---|
public | IlcIntToIntStepFunction() |
public | IlcIntToIntStepFunction(IlcSegmentedFunctionI * impl) |
public | IlcIntToIntStepFunction(IloSolver solver, IlcInt xmin=IlcIntMin, IlcInt xmax=IlcIntMax, IlcInt dval=0) |
public | IlcIntToIntStepFunction(IloSolver solver, IlcIntArray x, IlcIntArray v, IlcInt xmin=IlcIntMin, IlcInt xmax=IlcIntMax) |
Method Summary | |
---|---|
public void | addValue(IlcInt x1, IlcInt x2, IlcInt v) |
public void | dilate(IlcInt k) |
public IlcInt | getArea(IlcInt x1, IlcInt x2) const |
public IlcInt | getDefinitionIntervalMax() const |
public IlcInt | getDefinitionIntervalMin() const |
public IlcSegmentedFunctionI * | getImpl() const |
public IlcInt | getMax(IlcInt x1, IlcInt x2) const |
public IlcInt | getMin(IlcInt x1, IlcInt x2) const |
public const char * | getName() const |
public IlcAny | getObject() const |
public IloSolver | getSolver() const |
public IloSolverI * | getSolverI() const |
public IlcInt | getValue(IlcInt x) const |
public void | operator*=(IlcInt k) |
public void | operator+=(const IlcIntToIntStepFunction & fct) |
public void | operator-=(const IlcIntToIntStepFunction & fct) |
public void | operator=(const IlcIntToIntStepFunction & h) |
public void | setMax(const IlcIntToIntStepFunction & fct) |
public void | setMax(IlcInt x1, IlcInt x2, IlcInt v) |
public void | setMin(const IlcIntToIntStepFunction & fct) |
public void | setMin(IlcInt x1, IlcInt x2, IlcInt v) |
public void | setName(const char * name) const |
public void | setObject(IlcAny object) const |
public void | setPeriodic(const IlcIntToIntStepFunction & fp, IlcInt x0, IlcInt n=IlcIntMax, IlcInt dval=0) |
public void | setSteps(IlcIntArray x, IlcIntArray v) |
public void | setValue(IlcInt x1, IlcInt x2, IlcInt v) |
public void | shift(IlcInt dx, IlcInt dval=0) |
Constructor Detail |
---|
This constructor creates an integer step function defined everywhere on the interval
[xmin,xmax)
with the same value dval
.
This constructor creates an integer step function defined everywhere on the interval
[xmin,xmax);
its steps are defined by the two arrays of parameters,
x
and v
.
More precisely, if n
is the size of array x
, the size of
array v
must be n+1
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]
on interval
[x[i-1],x[i])
for all
i
in
[0,n-1]
, and
v[n]
on interval
[x[n-1],xmax)
.Method Detail |
---|
This member function increases the value of the invoking integer step function by v
everywhere on the interval [x1,x2)
.
This member function multiplies the scale of x
by k
for the invoking integer
step function. The parameter k
must be a positive integer.
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
.
This member function returns the sum of the invoking integer step function over the interval
[x1,x2)
.
If the interval [x1,x2)
is not included in the interval of definition of the invoking
function, Solver will throw an exception (an instance of IloSolver::SolverErrorException
).
This member function returns the rightmost point of the interval of definition of the invoking step function.
This member function returns the leftmost point of the interval of definition of the invoking step function.
This member function returns the maximal value of the invoking integer step function on the
interval [x1,x2)
. If the interval [x1,x2)
is not included in the interval of
definition of the invoking function, Solver will throw an exception (an instance of
IloSolver::SolverErrorException
).
This member function returns the minimal value of the invoking integer step function on the
interval [x1,x2)
. If the interval [x1,x2)
is not included in the interval
of definition of the invoking function, Solver will throw an exception (an instance of
IloSolver::SolverErrorException
).
This member function returns an instance of IloSolver
associated with the invoking object.
This member function returns a pointer to the implementation object of the solver where the invoking object was extracted.
This member function returns the value of the invoking integer step function at
x
. If x
does not belong to the interval of definition of the
invoking function, Solver will throw an exception (an instance of
IloSolver::SolverErrorException
).
This operator multiplies the value of the invoking integer step function by a factor k
everywhere on the interval of definition.
This operator adds the parameter function fct
to the invoking integer step function.
This operator subtracts the parameter function fct
from the invoking integer step function.
This member function sets the value of the invoking integer step function to be the maximum between the
current value and the value of fct
everywhere on the interval of definition of the invoking
function. The interval of definition of fct
must be the same as that of the invoking step function.
This member function sets the value of the invoking integer step function to be the maximum between
the current value and v
everywhere on the interval [x1,x2)
.
This member function sets the value of the invoking integer step function to be the minimum between the current value and the value of fct everywhere on the interval of definition of the invoking function. The interval of definition of fct must be the same as the one of the invoking step function.
This member function sets the value of the invoking integer step function to be the minimum between
the current value and v
everywhere on the interval [x1,x2)
.
This member function initializes the invoking function as an integer step function that repeats
the step function fp
, n
times after x0
.
More precisely, if fp
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) % (xfpmax-xfpmin))
for
x
in
[x0, Min(x0+n*(xfpmax-xfpmin), xmax))
, and
dval
on
[Min(x0+n*(xfpmax-xfpmin), xmax), xmax)
This member function initializes the invoking function as an integer step function whose
steps are defined by the two parameters 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)
.This member function sets the value of the invoking integer step function to be v
on the interval [x1,x2)
.
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)
: former value at
x-dx
.If dx < 0
, the new value of the invoking function is:
x
in
[xmin,xmax+dx)
: former value at
x-dx
,
dval
on the interval
[xmax+dx,xmax)
.