jump-dev / PiecewiseLinearOpt.jl

Solve optimization problems containing piecewise linear functions
Other
53 stars 21 forks source link

allow BivariatePWLFunction to accept a matrix of values at breakpoint pairs #27

Open chriscoey opened 6 years ago

chriscoey commented 6 years ago

for univariate, you are allowed to pass in a vector of breakpoints and a vector of function values at those points. bivariate forces you to pass in a function, but it should allow the matrix of values analogously to univariate. note that some patterns will be unavailable (BestFit).

AndreOlds commented 4 years ago

I am facing the same issue. Is there a quick manner to convert a matrix of 2D values into a function to enable using the methods implemented in this package?

Thanks

joehuchette commented 4 years ago

It's not trivial, but also should be doable in a one or two dozen LOC: given input x, compute which domain triangle x lies upon, then compute the value of the affine function that passes through the corresponding breakpoint values.

I'm in the middle of a rewrite of the package which will make this easy to do.