(class from pyomo.core.kernel.piecewise_library.transforms)
pyomo.core.kernel.piecewise_library.transforms
Bases: object
object
A piecewise linear function
Piecewise linear functions are defined by a list of breakpoints and a list function values corresponding to each breakpoint. The function value between breakpoints is implied through linear interpolation.
breakpoints (list) – The list of function breakpoints.
values (list) – The list of function values (one for each breakpoint).
validate (bool) – Indicates whether or not to perform validation of the input data. The default is True. Validation can be performed manually after the piecewise object is created by calling the validate() method. Validation should be performed any time the inputs are changed (e.g., when using mutable parameters in the breakpoints list).
True
validate()
**kwds – Additional keywords are passed to the validate() method when the validate keyword is True; otherwise, they are ignored.
validate
Methods
__init__(breakpoints, values[, validate])
__init__
validate([equal_slopes_tolerance])
Validate this piecewise linear function by verifying various properties of the breakpoints and values lists (e.g., that the list of breakpoints is nondecreasing).
Attributes
breakpoints
The set of breakpoints used to defined this function
values
The set of values used to defined this function
Member Documentation
equal_slopes_tolerance (float) – Tolerance used check if consecutive slopes are nearly equal. If any are found, validation will fail. Default is 1e-6.
a function characterization code (see util.characterize_function())
util.characterize_function()
int
PiecewiseValidationError – if validation fails