StepFunctions.SortedDomainIteratorStepFunctions.StepFunctionStepFunctions.StepFunctionStepFunctions.ValueSweepIteratorStepFunctions.lines_dataStepFunctions.restrictStepFunctions.to_minimal_stepfct_data
StepFunctions.SortedDomainIterator — Type
struct SortedDomainIterator{S,T}An iterator that iterates over the sorted union of the domains of the step functions.
StepFunctions.StepFunction — Type
struct StepFunction{X<:Real,Y}A step function is a piecewise constant function. It is represented by a vector $x$, a real $y_0$ and $y$ as follows:
$f(t) = \begin{cases} y_0 & \text{if } t < x_{1} \\ y_{i} & \text{if } x_i \leq t < x_{i+1} \\ y_{\text{end}} & \text{if } t \geq x_{\text{end}} \end{cases}$
The values of $x$ and $y$ are saved in vectors xs and ys, respectively. We must have length(xs) == length(ys). Furthermore, xs must be a sorted vector of sorted reals.
StepFunctions.StepFunction — Method
StepFunction(xs::Vector,ys::Vector)Create the step function StepFunction(xs,ys[1],ys[2:end]) where xs is a vector of the step locations and ys is a vector of the step values. Here, length(xs)+1 must be equal to length(ys).
StepFunctions.ValueSweepIterator — Type
struct ValueSweepIterator{X,Y,XS}Iterates over the values of a step function at the points in a sorted iterator xs.
StepFunctions.lines_data — Method
lines_data(f::StepFunction, a::Real, b::Real)Returns series $xs$ and $ys$ that can be used to plot the step function f over the interval [a,b].
StepFunctions.restrict — Method
restrict(f::StepFunction, a::Real, b::Real)Sets the values of f to zero outside the interval [a,b].
StepFunctions.to_minimal_stepfct_data — Method
function to_minimal_stepfct_data!(xs, y0, ys)Removess successive identical xs and ys values from the data of a step function.