Piecewise linear function
In mathematics, a piecewise linear function
- ,
where V is a vector space and is a subset of a vector space, is any function with the property that can be decomposed into finitely many convex polytopes, such that f is equal to a linear function on each of these polytopes. (Here, the term linear function is not restricted to linear transformations, but is used in the more general sense of affine transformation.)
A special case is when f is a real-valued function on an interval . Then f is piecewise linear if and only if can be partitioned into finitely many sub-intervals, such that on each such sub-interval I, f is equal to a linear function
- f(x) = aIx + bI.
The absolute value function is a good example of a piecewise linear function. Other examples include the square wave, the sawtooth function, and the floor function.
Important sub-classes of piecewise linear functions include the continuous piecewise linear functions and the convex piecewise linear functions. Splines generalize piecewise linear functions to higher-order polynomials.