\resetsteps      % Reset all the commands to create a blank worksheet  

% Define the operation to be computed

%\renewcommand{\operation}{ \left[ A \right] := \mbox{\sc FLA_Chol_l\_blk}( A ) }
\renewcommand{\routinename}{ A \becomes \mbox{\sc Chol\_l\_blk\_var2( A ) } }

% Step 1a: Precondition 

\renewcommand{\precondition}{
  A = \hat{A}
}

% Step 1b: Postcondition 

\renewcommand{\postcondition}{ 
  \left[A \right]
  =
  \mbox{FLA_Chol_l}( A )
}

% Step 2: Invariant 
% Note: Right-hand side of equalities must be updated appropriately

\renewcommand{\invariant}{
  \FlaTwoByTwo{A_{TL}}{A_{TR}}
              {A_{BL}}{A_{BR}} =
  \FlaTwoByTwo{\hat{A}_{TL}}{\hat{A}_{TR}}
              {\hat{A}_{BL}}{\hat{A}_{BR}}
}

% Step 3: Loop-guard 

\renewcommand{\guard}{
  m( A_{TL} ) < m( A )
}

% Step 4: Initialize 

\renewcommand{\partitionings}{
  $
  A \rightarrow
  \FlaTwoByTwo{A_{TL}}{A_{TR}}
              {A_{BL}}{A_{BR}}
  $
}

\renewcommand{\partitionsizes}{
$ A_{TL} $ is $ 0 \times 0 $
}

% Step 5a: Repartition the operands 

\renewcommand{\blocksizeftex}{b}

\renewcommand{\repartitionings}{
$
  \FlaTwoByTwo{A_{TL}}{A_{TR}}
              {A_{BL}}{A_{BR}}
  \rightarrow
  \FlaThreeByThreeBR{A_{00}}{A_{01}}{A_{02}}
                    {A_{10}}{A_{11}}{A_{12}}
                    {A_{20}}{A_{21}}{A_{22}}
$
}

\renewcommand{\repartitionsizes}{
  $ A_{11} $ is $ b \times b $
}

% Step 5b: Move the double lines 

\renewcommand{\moveboundaries}{
$
  \FlaTwoByTwo{A_{TL}}{A_{TR}}
              {A_{BL}}{A_{BR}}
  \leftarrow
  \FlaThreeByThreeTL{A_{00}}{A_{01}}{A_{02}}
                    {A_{10}}{A_{11}}{A_{12}}
                    {A_{20}}{A_{21}}{A_{22}}
$
}

% Step 6: State after repartitioning
% Note: The below needs editing!!!

\renewcommand{\beforeupdate}{
  \FlaThreeByThreeBR{A_{00}}{A_{01}}{A_{02}}
                    {A_{10}}{A_{11}}{A_{12}}
                    {A_{20}}{A_{21}}{A_{22}}
=
  \FlaThreeByThreeBR{\hat{A}_{00}}{\hat{A}_{01}}{\hat{A}_{02}}
                    {\hat{A}_{10}}{\hat{A}_{11}}{\hat{A}_{12}}
                    {\hat{A}_{20}}{\hat{A}_{21}}{\hat{A}_{22}}
}

% Step 7: State after moving of double lines
% Note: The below needs editing!!!

\renewcommand{\afterupdate}{
  \FlaThreeByThreeTL{A_{00}}{A_{01}}{A_{02}}
                    {A_{10}}{A_{11}}{A_{12}}
                    {A_{20}}{A_{21}}{A_{22}}
=
  \FlaThreeByThreeTL{\hat{A}_{00}}{\hat{A}_{01}}{\hat{A}_{02}}
                    {\hat{A}_{10}}{\hat{A}_{11}}{\hat{A}_{12}}
                    {\hat{A}_{20}}{\hat{A}_{21}}{\hat{A}_{22}}
}

% Step 8: Insert the updates required to change the 
%         state from that given in Step 6 to that given in Step 7
% Note: The below needs editing!!!

\renewcommand{\update}{
$
  \begin{array}{ll}
                                             & \\[-2.5mm]
    A_{11} \becomes A_{11} - A_{10} A_{11}^T & \hspace{0.55in} \mbox{\sc (syrk)} \\[0.5mm]
    A_{21} \becomes A_{21} - A_{20} A_{10}^T & \hspace{0.55in} \mbox{\sc (gemm)} \\[0.5mm]
    A_{11} \becomes \Chol{A_{11}}            &                                   \\[0.1mm]
    A_{21} \becomes A_{21} A_{11}^{-T}       & \hspace{0.55in} \mbox{\sc (trsm)}
  \end{array}
$
}

