## Name

op_fitz_brute — [For comparison only] Evaluate the Fitzpatrick function of a given operator on a grid.

## Calling Sequence

    F = op_fitz_brute(A, n, x, xstar)

## Parameters

A

  matrix. An operator [a;a*] where a and a* are row vectors.

n

  integer. The order of the Fitzpatrick function to compute.

x

  column vector. The x values of the grid on which the Fitzpatrick function is evaluated.

xstar

  column vector. The x* values of the grid on which the Fitzpatrick function is evaluated.

## Description

<listitem>

Warning: This function is provided only for comparison and unit testing. Faster results are achieved by using op_fitz.

Evaluates the Fitzpatrick function with order n of an operator A on a grid (x,x*).

This function uses the brute-force approach given by following formula. For each (x,x*) combination, it computes the maximum of the sums from all permutations of n-1 (a,a*) pairs. The algorithm runs in exponential O(n*m^(n-1)*N) time, and if m==Nx==Nxstar, then it runs O(n*m^(n+1)).

                                                     n-2
        F(A, n, x, xstar) =         sup              sum [ <a(i+1)-a(i),astar(i)> ] + <x-a(n-1),astar(n-1)> + <a(1),xstar>
                            (a(1),astar(1)) in A     i=1
                                    ...
                         (a(n-1), astar(n-1)) in A

        where <., .> is the scalar dot product.

        m = size(A, 2);
        Nx = size(x, 1);
        Nxstar = size(xstar, 1);
        N = Nx * Nxstar;

</listitem>

## Examples

    a = 1:4;
    astar = 2*a^2 - 9;
    x = 0:5;
    xstar = -1:5;
    F = op_fitz_brute([a; astar], 2, x, xstar),

    clf(); alpha=51; theta=162;
    plot3d(x, xstar, F, alpha=alpha, theta=theta);

## See Also

op_fitz_direct , op_fitz , op_fitzinf , plq_fitzinf0 , plq_fitzinf0_direct , plq_rock

## Authors

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