# Cosine-Sine Decomposition: LAPACK Computational Routines

This topic describes LAPACK computational routines for computing the cosine-sine decomposition (CS decomposition) of a partitioned unitary/orthogonal matrix. The algorithm computes a complete 2-by-2 CS decomposition, which requires simultaneous diagonalization of all the four blocks of a unitary/orthogonal matrix partitioned into a 2-by-2 block structure.

The computation has the following phases:

# ?bbcsd

Computes the CS decomposition of an orthogonal/unitary matrix in bidiagonal-block form.

# ?orbdb/?unbdb

Simultaneously bidiagonalizes the blocks of a partitioned orthogonal/unitary matrix.

# LAPACK Least Squares and Eigenvalue Problem Driver Routines

Each of the LAPACK driver routines solves a complete problem. To arrive at the solution, driver routines typically call a sequence of appropriate computational routines.

Driver routines are described in the following topics :

Linear Least Squares (LLS) Problems

# Linear Least Squares (LLS) Problems: LAPACK Driver Routines

This topic describes LAPACK driver routines used for solving linear least squares problems. Table "Driver Routines for Solving LLS Problems" lists all such routines for the FORTRAN 77 interface. The corresponding routine names in the Fortran 95 interface are without the first symbol.

# ?gels

Uses QR or LQ factorization to solve a overdetermined or underdetermined linear system with full rank matrix.

# ?gelsy

Computes the minimum-norm solution to a linear least squares problem using a complete orthogonal factorization of A.

# ?gelss

Computes the minimum-norm solution to a linear least squares problem using the singular value decomposition of A.

# ?gelsd

Computes the minimum-norm solution to a linear least squares problem using the singular value decomposition of A and a divide and conquer method.

# ?getsls

Uses QR or LQ factorization to solve an overdetermined or underdetermined linear system with full rank matrix, with best performance for tall and skinny matrices.