next up previous contents index
Next: The -algorithm for symmetric Up: Implementations and numerical experiments Previous: Implementations and numerical experiments   Contents   Index

The implementation of the $ QR$-factorization of semiseparable plus diagonal matrices

Here we will describe the $ O(n)$ implementation to solve a system of equations where the coefficient matrix is a semiseparable plus diagonal matrix. The implementation we present computes first the $ QR$-factorization of the semiseparable plus diagonal matrix and will be used to solve the system via backward substitution. First we recall the $ QR$-solver and the algorithm as introduced in [178]. Suppose a semiseparable matrix $ S$ and a diagonal matrix $ D$ are given. The first sequence of Givens transformations applied to the matrix $ S$ will transform the matrix into an upper triangular matrix $ \tilde{R}=Q_1^TS$. Moreover, because the matrix we started from was a semiseparable matrix, the upper triangular factor $ \tilde{R}$, will have semiseparability rank $ 2$. Performing now these $ n-1$ Givens transformations on the diagonal $ D$ this results in a Hessenberg matrix $ \tilde{H}$, for which the upper triangular part is of semiseparability rank $ 1$. We have even more structure because the transformations performed on the semiseparable and the diagonal are the same, we can combine the Hessenberg matrix $ \tilde{H}$ and $ \tilde{R}$ to a matrix whose upper triangular part has semiseparability rank $ 2$.

This can briefly be formulated into a theorem

Theorem 83 (From [178])   Suppose a semiseparable matrix $ S$ and a diagonal $ D$ are given, then there exists a sequence of Givens transformations $ G_1,\ldots,G_{n-1}$, such that the following equality holds:

$\displaystyle G_{n-1}^T\cdots G_1^T \left( S+D \right) = \tilde{R} + \tilde{H} = H,$    

where $ \tilde{R}$ is an upper triangular semiseparable matrix with semiseparability rank $ 2$. $ \tilde{H}$ denotes a Hessenberg matrix with the upper triangular part of semiseparability rank $ 1$. The matrix $ H$ is a Hessenberg matrix, whose upper triangular part is semiseparable and of semiseparability rank $ 2$.

As we want an upper triangular matrix and not a Hessenberg one, a final sequence of Givens transformations $ Q_2^T$ is needed, to annihilate the subdiagonal elements of the Hessenberg matrix $ H$. These Givens transformations are performed from top to bottom. Moreover, because these Givens transformations are performed on the matrix $ H$ the upper triangular semiseparable structure will be destroyed a little bit. Instead of an upper triangular part of semiseparability rank $ 2$, we have now a strictly upper triangular part of semiseparability rank $ 2$. This knowledge about the structure makes it possible to implement this algorithm in $ O(n)$ operations and to solve systems with semiseparable plus diagonal matrices in a fast way. We will now construct in more detail the implementation, which calculates the $ QR$-factorization of a semiseparable matrix, and solves a system of equations with it.

For the implementation the semiseparable plus diagonal matrix is not split up in two parts, as in the theoretical overview, but into three separate parts, namely the lower triangular part of the semiseparable matrix, the strictly upper triangular part of the semiseparable matrix and a diagonal. In fact we have the following decomposition

$\displaystyle {S+D}$
  $\displaystyle =$ $\displaystyle L_S + U_S + D$  
  $\displaystyle =$ $\displaystyle \left( \begin{array}{cccccc}
c_1 d_1 & 0 & 0 & \ldots & 0 & 0 \\ ...
...} s_{n-2} \cdots s_1 d_1 & \ldots & & & s_{n-1}d_{n-1}& d_n
\end{array} \right)$  
  $\displaystyle +$ $\displaystyle \left( \begin{array}{cccccc}
0 & r_1 e_1 & r_2 t_1 e_1 & \ldots &...
...2}\\
0 & \ldots & & & 0 & e_{n-1} \\
0& \ldots & & & 0& 0
\end{array} \right)$  
  $\displaystyle +$ $\displaystyle \left( \begin{array}{cccccc}
\hat{d}_1 & \\
& \hat{d}_2 & \\
& & \ddots & \\
& & & \hat{d}_n
\end{array} \right).$  

In the previous splitting of the semiseparable plus diagonal matrix, we already assumed that our semiseparable parts are represented with the Givens-vector representation. For the lower triangular semiseparable matrix we denote the representation with $ G$ and $ d$, for the strictly upper triangular part we use $ H$ and $ e$:
$\displaystyle G$ $\displaystyle =$ \begin{displaymath}\left(
\begin{array}{cccc}
c_1 & c_2 & \ldots & c_{n-1} \\
s_1 & s_2 & \ldots & s_{n-1}
\end{array} \right)\end{displaymath}  
$\displaystyle d$ $\displaystyle =$ $\displaystyle \left( d_1,d_2,\ldots,d_n \right)$  
$\displaystyle H$ $\displaystyle =$ \begin{displaymath}\left(
\begin{array}{cccc}
r_1 & r_2 & \ldots & r_{n-2} \\
t_1 & t_2 & \ldots & t_{n-2}
\end{array} \right)\end{displaymath}  
$\displaystyle e$ $\displaystyle =$ $\displaystyle \left( e_1,e_2,\ldots,e_{n-1} \right).$  

The Givens transformations $ G_i$ and $ H_i$ are denoted as

% latex2html id marker 38876
$\displaystyle G_i=\left( \begin{array}{cr} c_i & -...
...uad H_i =\left( \begin{array}{cr} r_i & -t_i \\  t_i & r_i \end{array} \right).$    

Let us denote with $ \hat{d}_i$ the diagonal elements of the matrix $ D$. As we already used $ G_i$ for the Givens transformations involved in the Givens-vector representation of the matrix we denote with $ \tilde{G}_i$ the Givens transformations from the $ QR$-factorization. These Givens transformations satisfy $ \tilde{G}_1=G_{n-1},\ldots,\tilde{G}_{n-1}=G_1$. Applying $ \tilde{G}_1^T,\ldots,\tilde{G}^T_{n-1}$ to the lower triangular semiseparable matrix from bottom to top, will transform this matrix into an upper triangular semiseparable matrix. We take a closer look at the matrix $ L_S+D$ after applying the Givens transformation $ \tilde{G}_{1}^T$ to the left. We get the following structure for the lower triangular matrix $ L_S$:
% latex2html id marker 38899
$\displaystyle \left( \begin{array}{ccccccc}
c_1 d_...
..._{n-1}
& s_{n-1} d_n \\
0 &\ldots & & & & 0 & c_{n-1} d_n
\end{array} \right).$      

The diagonal matrix $ D$ will change in the following way:

% latex2html id marker 38903
$\displaystyle \left( \begin{array}{cccrc} \hat{d}_...
...}_{n} \\  & & & -s_{n-1} \hat{d}_{n-1} & c_{n-1} \hat{d}_n \end{array} \right).$    

It can be seen now that the upper triangular zero part is slowly filled with elements depending on each other. In fact a semiseparable part is created from bottom to top, for which the Givens transformations in the Givens-vector representation are the Givens transformations $ G_{n-1},\ldots,G_1$. One more Givens transformation $ \tilde{G}_{2}^T$ is applied such that we can also see the pattern in the expansion for the elements in the vector of the new representation. After applying the transformation $ \tilde{G}_{2}^T$ on the rows $ n-1$ and $ n-2$ we get the following matrices:
% latex2html id marker 38916
$\displaystyle \left( \begin{array}{ccccccc}
c_1 d_...
...& c_{n-2} s_{n-1} d_n \\
0 &\ldots & & & & 0 & c_{n-1} d_n
\end{array} \right)$      

and

% latex2html id marker 38918
$\displaystyle \left( \begin{array}{cccccc} \hat{d}...
...\\  & & & & -s_{n-1} \hat{d}_{n-1} & c_{n-1} \hat{d}_n \\  \end{array} \right).$    

After all the Givens transformations $ G_i$ are applied on the matrix $ L_S+D$, the subdiagonal elements from top to bottom are the following ones:

$\displaystyle \left( -s_1
\hat{d}_1, \ldots ,-s_{n-2}\hat{d}_{n-2},-s_{n-1}
\hat{d}_{n-1} \right).$

The new vector in the Givens-vector representation from bottom to top has the following form:

$\displaystyle \tilde{d}=\left(
d_n+\hat{d}_n,d_{n-1}+c_{n-1}\hat{d}_{n-1},d_{n-2}+c_{n-2}\hat{d}_{n-2},
\ldots, d_2 + c_2 \hat{d}_2,d_1+c_1\hat{d}_1 \right).$

The procedure described above is an $ O(n)$ procedure, when implementing everything with the Givens-vector representation. However, we did not yet took into consideration the strictly upper triangular part $ U_S$. We know that this matrix has the representation from left to right. This is an advantage in the next procedure, because the Givens transformations are performed on the left, they will not change the dependencies between the columns. The rough idea will be, to apply a Givens transformation, which will clearly disturb the semiseparable structure, because of fill-in in the diagonal. However, because still a following sequence of Givens transformations is needed , we can take out a term in the corresponding diagonal element of $ \tilde{d}$ and add it to our transformed matrix $ U_S$, such that the dependency between the columns is maintained. In this way, we will create an upper triangular semiseparable matrix for which the dependencies between the columns did not change, only the new diagonal elements need to be calculated, this is illustrated in the following equations.

Applying the Givens transformation $ \tilde{G}_{1}^T=G_{n-1}^T$ on the left of the matrix $ U_S$ we get the following structure:

% latex2html id marker 38940
$\displaystyle \left( \begin{array}{cccccc} 0 & r_1...
...0 & c_{n-1} e_{n-1} \\  0& \ldots & & & 0& -s_{n-1} e_{n-1} \end{array} \right)$    

To create an upper triangular semiseparable matrix, an element $ x_{n-1}$ has to be added in position $ (n-1,n-1)$ such that the last two columns will satisfy again the semiseparable structure. This means in fact that an element $ x_{n-1}$ has to be added such that the following block will be of rank $ 1$:

% latex2html id marker 38950
$\displaystyle \left( \begin{array}{cc} r_{n-2} e_{n-2} & t_{n-2} e_{n-2} \\  x_{n-1} & c_{n-1} e_{n-1} \end{array} \right).$    

When doing so, the corresponding element of $ \tilde{d}$, namely $ \tilde{d}_{n-1}$ has to be diminished with this term $ x_{n-1}$. (Note that this can be done without any problem, because the Givens transformations applied to the left are the same for $ L_S$ and $ U_S$.)

We can now continue and perform the next Givens transformation $ \tilde{G}_{2}$, on the matrix in which we added the element $ x_{n-1}$ (Only the last four rows and columns are shown):

% latex2html id marker 38966
$\displaystyle \left( \begin{array}{cccc} 0 & r_{n-...
...n-1}-s_{n-2}t_{n-2}e_{n-2} \\  0 &0 & 0 & -s_{n-1} e_{n-1} \end{array} \right).$    

We can continue this process and calculate $ x_{n-2}$. Using this procedure, one can design an $ O(n)$ calculation transforming $ U_S$ into an upper triangular semiseparable part having hte following representation from left to right. For the Givens transformations we have:

% latex2html id marker 38974
$\displaystyle \tilde{H}=\left( \begin{array}{ccccc...
...r_2 & \ldots & r_{n-2} \\  1 & t_1 & t_2 & \ldots & t_{n-2} \end{array} \right)$    

and the new diagonal elements, denoted with $ \tilde{e}$, are:

$\displaystyle \left( \frac{c_1r_1e_1+s_1x_2}{r_1}, \frac{-s_1r_1e_1+c_1x_2}{r_1...
...rac{-s_{n-2}r_{n-2}e_{n-2}+ c_{n-2}x_{n-1}}{r_{n-2}} , -s_{n-1}e_{n-1} \right).$    

One should not forget to substract from the elements of the vector $ \tilde{d}$ the corresponding elements $ x_i$.

Note 22   The implementation as designed here, presumes that we are in the ideal case, i.e., there are no divisions by zero, all the elements are different from zero etc. The practical implementation, is changed a little bit, such that also the not ideal situations are dealt with in a correct way.

The final step consists of transforming the Hessenberg matrix into an upper triangular matrix. We will not describe this step in detail like in the previous ones, because it is a straightforward generalization of the Givens transformations applied to $ U_S$. First we need to swap the representation of $ G$, and $ \tilde{d}$ towards a representation from left to right. In this way, both the representations of the upper triangular part of the Hessenberg matrix are from left to right. The application of the second sequence of Givens transformations to annihilate the subdiagonal elements of the Hessenberg matrix, will therefore not change the dependencies between the columns, but only the diagonal will be disturbed. Therefore we exclude the diagonal, and calculate the new Givens-vector representation of the strictly upper triangular part of the matrix $ R$. In this way we get a diagonal and two Givens-vector representations which will represent the strictly upper triangular part.

Solving a linear system of equations with the $ QR$-algorithm for semiseparable matrices is an easy application of the above decomposition. First we calculate the $ QR$-factorization of $ S+D=QR$. Suppose we want to solve the system $ (S+D)x=b$. This is equivalent to solving $ Rx=Q^Tb$, and then solving the final part via backward substitution. This final backward substitution can also be implemented in $ O(n)$. To do so the same techniques as described in Section 2.8.2 have to be applied.

This algorithm can be used for example to calculate eigenvectors corresponding to particular eigenvalues, via inverse iteration.


next up previous contents index
Next: The -algorithm for symmetric Up: Implementations and numerical experiments Previous: Implementations and numerical experiments   Contents   Index
Raf Vandebril 2004-05-03