## Name

plq_rock — Compute the PLQ Rockafellar function R(A,a(k)) of an operator A.

## Calling Sequence

    R = plq_rock(B, k)

## Parameters

B

  matrix. A matrix [a;bm;bp] where a, bm (b-), and bp (b+) are row vectors as defined below.

k

  integer. 1<=k<=m. The index of the a values for which to compute R(A,a(k)). i<=k use bm, i>=k use bp.

## Description

<listitem>

Compute the PLQ Rockafellar function R(A,a(k)) of an operator A, where B is defined below. This function runs in linear time, computing a PLQ piece for each i=1:m+1 where a(i-1) < x <= a(i).

        B : x -> conv(A*x):
              m
            union ( {a(i)} cross [bm(i),bp(i)] )
             i=1

        with a(1) < a(2) < ... < a(m),
             bm(1) <= bp(1) <= bm(2) <= bp(2) <= ... <= bm(m) <= bp(m),
             a(0) = bm(0) = bp(0) = -%inf,
             a(m+1) = bm(m+1) = bp(m+1) = %inf,
             m = size(B,2).

        R(A, a(k))(x) = { (x-a(i))*bm(i) + sum(j=i+1:k, (a(j-1)-a(j))*bm(j)) , if a(i-1) < x <= a(i) <= a(k)
                        { (x-a(i))*bp(i) + sum(j=k:i-1, (a(j+1)-a(j))*bp(j)) , if a(k) <= a(i) <= x <= a(i+1)

</listitem>

## Examples

    a = 1:5;
    bm = [-10,-4, 1, 2, 5];
    bp = [- 5, 0, 2, 4, 7];
    B = [a;bm;bp];
    plq_rock(B, 1),
    plq_rock(B, 5),

## See Also

op_fitz_brute , op_fitz_direct , op_fitz , op_fitzinf , plq_fitzinf0 , plq_fitzinf0_direct

## Authors

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