公共接口IloNumToNumStepFunction
IloNumToNumStepFunction的实例代表一个阶跃函数,它在区间 [xMin, 'xMax) 上的任何地方都有定义。函数值相同的每个区间 [x1, 'x2) 称为一个阶跃。
请注意,如果n是函数的步数,那么随机访问给定步数(参见成员函数 "setValue)的最坏情况复杂度为O(log(n))。
此外,当函数的两个连续步长具有相同值时,这些步长会被合并,从而始终以最少的步长表示函数。
| 修饰符和类型 | 方法和说明 |
|---|---|
void |
add(IloNumToNumStepFunction fct)此操作符将参数函数 "
fct添加到调用的步进函数中。 |
void |
addValue(double x1,
double x2,
double v)该成员函数将 "
v添加到调用步进函数的值 "[x1, x2)区间的任何地方。 |
IloNumToNumStepFunction |
copy()该成员函数创建并返回一个新函数,它是调用函数的副本。
|
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)该成员函数返回区间 "
[x1, x2)上调用阶跃函数的总和。 |
double |
getDefinitionIntervalMax()该成员函数返回调用阶跃函数定义区间的最右端点。
|
double |
getDefinitionIntervalMin()该成员函数返回调用阶跃函数定义区间的最左点。
|
double |
getMax(double x1,
double x2)该成员函数返回调用步长函数在区间 "
[x1, x2)上的最大值。 |
double |
getMin(double x1,
double x2)该成员函数返回调用步长函数在区间 "
[x1, x2)上的最小值。 |
double |
getValue(double x)该成员函数返回调用步骤函数 "
x的值。 |
void |
prod(double k)该运算符将定义区间内各处调用的阶跃函数值乘以系数 "
k。 |
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)该成员函数将调用步长函数的值设置为调用函数定义区间内当前值与 "
fct值之间的最大值。 |
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)该成员函数将调用步长函数的值设置为调用函数定义区间内当前值与 "
fct值之间的最小值。 |
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)该成员函数在区间 "
[x1,x2)上更改调用函数的值。 |
void |
setPeriodicValue(double x1,
double x2,
IloNumToNumStepFunction f,
double offset)该成员函数在区间 "
[x1,x2)上更改调用函数的值。 |
void |
setSteps(ilog.concert.IloNumArray x,
ilog.concert.IloNumArray v)该成员函数将调用函数初始化为步进函数,其步进由两个参数数组 "
x和 "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)如果是 "
dx > 0,该成员函数将调用函数从 "dx向右移动;如果是 "dx < 0,该成员函数将调用函数从 "-dx向左移动。 |
void |
shift(double dx,
double dval)如果是 "
dx > 0,该成员函数将调用函数从 "dx向右移动;如果是 "dx < 0,该成员函数将调用函数从 "-dx向左移动。 |
void |
sub(IloNumToNumStepFunction fct)该运算符从调用的步进函数中减去参数函数 "
fct。 |
IloNumToNumStepFunctioncopy()
该成员函数创建并返回一个新函数,它是调用函数的副本。
voidsetValue(double x1、
双x2、
双 v)
This member function sets the value of the invoking step function to be v on the interval [x1, x2).
voidaddValue(double x1、
双x2、
双 v)
该成员函数将 "v添加到调用步进函数的值 "[x1, x2)区间的任何地方。
voidsetMax(double x1、
双x2、
双 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).
voidsetMin(double x1、
双x2、
双 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)
如果是 "dx > 0,该成员函数将调用函数从 "dx向右移动;如果是 "dx < 0,该成员函数将调用函数从 "-dx向左移动。 如果'dx = 0. 更确切地说,如果调用函数是在 "[xMin,xMax)和 "dx > 0"上定义的,则调用函数的新值为
dval"在 "[xMin, xMin+dx)区间上、[xMin+dx, xMax)中的所有 "x,前者的值为 "x-dx。如果为 "dx < 0,则调用函数的新值为
[xMin, xMax+dx)中的所有 "x,前者的值为 "x-dxdval"在 "[xMax+dx,xMax)区间上。void shift(double dx、
双 dval)
如果是 "dx > 0,该成员函数将调用函数从 "dx向右移动;如果是 "dx < 0,该成员函数将调用函数从 "-dx向左移动。 如果'dx = 0. 更确切地说,如果调用函数是在 "[xMin,xMax)和 "dx > 0"上定义的,则调用函数的新值为
dval"在 "[xMin, xMin+dx)区间上、[xMin+dx, xMax)中的所有 "x,前者的值为 "x-dx。如果为 "dx < 0,则调用函数的新值为
[xMin, xMax+dx)中的所有 "x,前者的值为 "x-dxdval"在 "[xMax+dx,xMax)区间上。doublegetDefinitionIntervalMin()
该成员函数返回调用阶跃函数定义区间的最左点。
doublegetDefinitionIntervalMax()
该成员函数返回调用阶跃函数定义区间的最右端点。
doublegetValue(doublex)
该成员函数返回调用步骤函数 "x的值。 An instance of IloException is thrown if x does not belong to the definition interval of the invoking function.
doublegetMax(double x1、
双倍x2)
该成员函数返回调用步长函数在区间 "[x1, x2)上的最大值。 An instance of IloException is thrown if the interval [x1, x2) is not included in the definition interval of the invoking function.
doublegetMin(double x1、
双倍x2)
该成员函数返回调用步长函数在区间 "[x1, x2)上的最小值。 An instance of IloException is thrown if the interval [x1, x2) is not included in the definition interval of the invoking function.
doublegetArea(double x1、
双倍x2)
该成员函数返回区间 "[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)
该运算符将定义区间内各处调用的阶跃函数值乘以系数 "k。
void addIloNumToNumStepFunctionfct)
此操作符将参数函数 "fct添加到调用的步进函数中。
void dilate(double k)
This member function multiplies by k the scale of x for the invoking step function. k必须是非负数值。 更确切地说,如果调用函数是在区间 "[xMin, xMax)上定义的,那么它将在区间 "[k*xMin,
k*xMax)上重新定义,"x处的值将是 "x/k处的前值。
void 'setSteps(ilog'.concert.IloNumArrayx、
ilogilog.concert.IloNumArrayv)
该成员函数将调用函数初始化为步进函数,其步进由两个参数数组 "x和 "v定义。 更确切地说,如果 "n是数组 "x的大小,则数组 "v的大小必须是 "n+1,如果调用的函数定义在区间 "[xMin,xMax)上,则其值将是:
v[0]在区间 "[xMin,x[0])上 、[0,n-1]中所有 "i的区间 "[x[i-1],x[i])"上的 "v[i],以及v[n]在区间 "[x[n-1],xMax)上 .void setPeriodic(IloNumToNumStepFunctionf、 双x0、 double n、 双 dval)
This member function initializes the invoking function as a step function that repeats the step function f, n times after x0. 更确切地说,如果 "f定义在 "[xfpMin,xfpMax)上,而调用函数定义在 "[xMin,xMax)上,则调用函数的值将是
dval对 "[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(IloNumToNumStepFunctionf、 双x0、 double n)
This member function initializes the invoking function as a step function that repeats the step function f, n times after x0. 更确切地说,如果 "f定义在 "[xfpMin,xfpMax)上,而调用函数定义在 "[xMin,xMax)上,则调用函数的值将是
[xMin, x0) 、fp((x-x0+xfpMin) % (xfpMax-xfpMin))代表 "[x0, Min(x0+n*(xfpMax-xfpMin), xMax))中的 "x,以及[Min(x0+n*(xfpMax-xfpMin), xMax), xMax)"为 0 void setPeriodic(IloNumToNumStepFunctionf、 doublex0)
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. 更确切地说,如果 "f定义在 "[xfpMin,xfpMax)上,而调用函数定义在 "[xMin,xMax)上,则调用函数的值将是
[xMin, x0) 、fp((x-x0+xfpMin) % (xfpMax-xfpMin))代表 "[x0, xMax)中的 "xvoidsetPeriodicValue(double x1、
双x2、
IloNumToNumStepFunctionf、
双偏移)
该成员函数在区间 "[x1,x2)上更改调用函数的值。 在此区间内,调用函数被设置为等于重复模式函数 "f,初始偏移量为 "offset。 调用函数不会在区间 "[x1,x2)之外进行修改。 更确切地说,如果 "[min,max)表示 "f的定义区间,那么对于 "[x1,x2)中的所有 "t","t"处的调用函数将被设置为等于 "f(min + (offset+t-x1)%(max-min))),其中 "%表示模运算符。 默认情况下,偏移量等于 0。
voidsetPeriodicValue(double x1、
双x2、
IloNumToNumStepFunctionf)
该成员函数在区间 "[x1,x2)上更改调用函数的值。 在此区间内,调用函数被设置为等于重复模式函数 "f,初始偏移量为 "offset。 调用函数不会在区间 "[x1,x2)之外进行修改。 更确切地说,如果 "[min,max)表示 "f的定义区间,那么对于 "[x1,x2)中的所有 "t","t"处的调用函数将被设置为等于 "f(min + (offset+t-x1)%(max-min))),其中 "%表示模运算符。 默认情况下,偏移量等于 0。
void setMin(IloNumToNumStepFunctionfct)
该成员函数将调用步长函数的值设置为调用函数定义区间内当前值与 "fct值之间的最小值。 fct的定义区间必须与调用步骤函数的定义区间相同。
void setMax(IloNumToNumStepFunctionfct)
该成员函数将调用步长函数的值设置为调用函数定义区间内当前值与 "fct值之间的最大值。 fct的定义区间必须与调用步骤函数的区间相同。
void subIloNumToNumStepFunctionfct)
该运算符从调用的步进函数中减去参数函数 "fct。