next up previous
Next: Numerical examples Up: The algorithm Previous: The bulge chasing

The QR-type algorithm using semiseparable matrices

In this section a complete description of the algorithm for finding the singular values is given. Assume that $ A\in \mathbb{R}^{m\times n}$ is an arbitrary matrix. All the functions used are defined in the previous subsections.

algorithm 5   The following function calculates the singular values of a matrix $ A$ using semiseparable matrices instead of the traditional bidiagonal matrices.

function [s]=svdss(A)

[n,m]=size(A);
S=triuSS(A);

% starting the main loop for
% finding all the singular values

while not found all the singular values

  %for this loop calculate kappa
  % using the Wilkonsonshift
  kappa=calculatekappa(S);

  % swap the matrix to lower triangular 
  S=swapdown(S)
  
  % calculate now the important Givens
  % Transformation based on the kappa
  Gimp=important givens(S,kappa)

  % applying the special Givens transformation
  S=S*Gimp;

  % chase down the just created bulge
  S=bulgechase(S);

  % swap the matrix to an upper triangular
  S=swapup(S);

  % now extract the singular values
  if a singular value is well approximated
    cut it off and continue working
    with the reduced matrix
  end
end



Raf Vandebril 2004-04-19