Skip to content

joehuchette/PiecewiseLinear.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PiecewiseLinear

A package for modeling optimization problems containing piecewise linear functions. Current support is for (the graphs of) continuous univariate functions.

Build Status

Coverage Status

codecov.io

This package offers helper functions for the JuMP algebraic modeling language.

Consider a piecewise linear function. The function is described in terms of the breakpoints between pieces, and the function value at those breakpoints.

Consider a JuMP model

using JuMP
m = Model()
@variable(m, x)

To model the graph of a piecewise linear function f(x), take d as some set of breakpoints along the real line, and fd = [f(x) for x in d] as the corresponding function values. You can model this function in JuMP using the following function:

z = piecewiselinear(m, x, d, fd)
@objective(m, Min, z) # minimize f(x)

Current support is limited to modeling the graph of a continuous univariate piecewise linear function, with the goal of adding support for the epigraphs of lower semicontinuous multivariate piecewise linear functions.

About

Optimizing over piecewise linear functions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages