API

PiecewiseLinearFunctions.PiecewiseLinearFunctionType
struct PiecewiseLinearFunction{T<:AbstractFloat}

Fields

  • x::Vector{T} where T<:AbstractFloat: x coordinates of the breakpoints

  • y::Vector{T} where T<:AbstractFloat: y coordinates of the breakpoints

  • left_slope::AbstractFloat: slope of the function to the left of the first breakpoint

  • right_slope::AbstractFloat: slope of the function to the right of the last breakpoint

source
PiecewiseLinearFunctions.composeMethod
compose(
    f::PiecewiseLinearFunction,
    g::PiecewiseLinearFunction;
    postprocess_breakpoints
) -> PiecewiseLinearFunction

Compute the composition f ∘ g of two piecewise linear functions. By default, the function checks for and removes redundant breakpoints in the output as a post processing step. For faster computation, set postprocess_breakpoints=false.

This method can also be called using Base.∘

source
PiecewiseLinearFunctions.convex_meetMethod
convex_meet(
    f::PiecewiseLinearFunction,
    g::PiecewiseLinearFunction
) -> PiecewiseLinearFunction

A faster version of convex_meet that only works on convex functions.

Warning

This function does not check if the input functions are convex.

source
PiecewiseLinearFunctions.old_convex_meetMethod
old_convex_meet(
    f::PiecewiseLinearFunction{T},
    g::PiecewiseLinearFunction{T}
) -> PiecewiseLinearFunction

Compute the convex meet of two piecewise linear functions, i.e. the tightest convex lower bound.

source