Piecewise linear quadratic (plq), Convex hull
plqco = plq_coSplit(plqf [,method])
matrix. A plq function whose convex hull will be computed.
optional string (default "direct"). Selects the algorithm used. May be "direct" or "split".
matrix. A plq function that is the convex hull of the original function.
Computes the convex hull of a continuous, but not necessarily convex, plq function, where the input and output are given in the form of a plq matrix.
The method argument selects which algorithm to use. The default is to use the faster, linear-time plq_coDirect algorithm, denoted by "direct". The plq_coSplit algorithm, which is based on convex duality, may be used as well, by specifying "split".
// The hull of a linear-linear-quadratic function: plqf = [0,0,0,%inf; 1,0,-1,1; 2,0,1,-1; 3,0,-1,3; 4,0,1,-3; %inf,0,0,%inf]; result = plq_co(plqf), scf(); plq_plotMultiple(%f, %f, plqf, result); // The hull of a more complicated function: plqf = [-5,0,0,%inf; -4,0,0,4; -3,0,-1,0; -2,0,-2,-3; 0,0,-0.5,0; .. 1,0,1,0; 2,0,0,1; 3,0,1,-1; 4,0,-1,5; 5,0,1,-3; 6,0,2,-8; .. 6.5,0,0,4; %inf,0,2,-9]; result = plq_co(plqf), scf(); plq_plotMultiple(%f, %f, plqf, result); | ![]() | ![]() |
Bryan Gardiner
, University of British Columbia, BC, Canada