## Name

plq_gph — Convert a PLQ subdifferential model to a standard PLQ model.

## Calling Sequence

    plq = plq_gph(gph)

## Parameters

gph

  matrix. The subdifferential of a PLQ function.

## Description

Converts the graph of the subdifferential of a PLQ function into the corresponding PLQ data structure. Uses the value of the function stored at each x value in gph and integrates across each segment.

This function runs in linear time with respect to the number of points in the input graph.

## Examples

    // The indicator function I_[-1,1].
    // Defined to be 0 inside [-1,1] and %inf outside.
    gph = [-1, -1, 1, 1; ..
           -1, 0, 0, 1; ..
           %inf, 0, 0, %inf];
    plq = plq_gph(gph),
    // plq  =
    //
    //  - 1.    0.    0.   Inf
    //    1.    0.    0.    0.
    //   Inf    0.    0.   Inf

    // A PLQ function:
    //   x in [-1,1]: 0
    //     otherwise: x^2 - 1
    gph = [-2, -1, -1, 1, 1, 2; ..
           -4, -2, 0, 0, 2, 4; ..
           3, 0, 0, 0, 0, 3];
    plq = plq_gph(gph),
    // plq  =
    //
    //  - 1.    1.    0.  - 1.
    //    1.    0.    0.    0.
    //   Inf    1.    0.  - 1.

## See Also

gph_plq

## Authors

`Bryan Gardiner`, University of British Columbia, BC, Canada