Derivation of LU Factorization Unblocked Variant 1

Operation to be computed:

where $x$ and $y$ are vectors of the same length, and $\alpha$ is their dot product (a scalar). We start with the blank worksheet

Step 1: Precondition and Postcondition

The precondition is given by the predicate

where $ \hat{\alpha} $ denotes the original contents of $ A $ and is a dummy variable. The postcondition is given by the predicate

These conditions are entered in the worksheet as Step 1a and 1b, as in

Step 2: Determine Loop-Invariants

As the computation progresses, the algorithms will sweep through the vectors exposing partitions:

where $ x_{L} $ and $ y_{L} $ are both vectors and of equal size.

To determine loop-invariants, we take these partitioned vectors and substitute them into the postcondition:

Manipulating this term yeilds

Depending on whether we choose to start from the top or the bottom of the vectors $x$ and $y$ , we find that $ \alpha $ can, at an intermediate stage, be in one of the following two states:

Invariant 1

\[
\alpha = \tr{x}_T y_T + \hat{\alpha}  
\]

Invariant 2

\[
\alpha = \tr{x}_B y_B + \hat{\alpha}  
\]

We will pick Invariant 1 for our subsequent discussion, which is entered in the worksheet as in

Step 3: Determine the Loop-Guard

Next we determine the loop-guard $ G $. Note that

must imply the postcondition. Taking $ G = ( m( x_{T} ) < m( x ) ) $ has this property.

The loop-guard is entered as Step 3, in

Step 4: Determine the Initialization

Now we determine an initialization that puts $ \alpha $ in a state where the loop-invariant is true. The partitioning

with $ x_{T} $ and $ \hat{y}_{T} $ both empty ($ 0 \times 0$) has the desired property. This is entered as Step 4, in

Step 5: Progressing through the Matrices

The initialization sets the top partitions to $ 0 \times 0 $ while the loop-guard indicates that the loop completes when these same paritions envelop the entire vectors. Thus, the algorithm must march through the vectors in a way that grows the top partition. Since we are trying to derive an unblocked algorithm, we choose to expose columns at the top of the loop that are then moved to the other side of the thick lines at the bottom of the loop, as in

Step 6: State after Repartitioning

The statement Repartition ... with ... exposes subvectors. We determine what the state of $ \alpha $ is in terms of these subvectors via textual substitution into the loop-invariant.

The repartitioning step

can be substitued into the loop-invariant, yielding

This is then entered in Step 6, in

Step 7: State after Moving the Lines

The statement Continue with ... redefines the quadrants. We determine what the state of matrix $ A $ must be if the loop-invariant is to again hold at the bottom of the loop, again via textual substitution into the loop-invariant.

The Continue with ... step The repartitioning step

Substituting these into the loop-invariant yields

This is then entered in Step 7, in

Step 8: Determining the Update

The question now becomes how to update the contents of matrix $ \alpha $ from

to

This justifies the update

which is entered as Step 8, in

Final Algorithm

By eliminating all references to the dummy variables $ \hat{\alpha} $, the algorithm for computing Apdot is left:

LinearAlgebraWiki: Apdot/Derivation/UnbVar1 (last edited 2007-05-24 22:13:51 by MarthaGanser)