class SingularValueDecomposition (View source)

For an m-by-n matrix A with m >= n, the singular value decomposition is an m-by-n orthogonal matrix U, an n-by-n diagonal matrix S, and an n-by-n orthogonal matrix V so that A = USV'.

The singular values, sigma[\$k] = S[\$k][\$k], are ordered so that sigma >= sigma >= ... >= sigma[n-1].

The singular value decompostion always exists, so the constructor will never fail. The matrix condition number and the effective numerical rank can be computed from this decomposition.

## Methods

__construct(mixed \$Arg)

Construct the singular value decomposition.

getU()

Return the left singular vectors.

getV()

Return the right singular vectors.

array
getSingularValues()

Return the one-dimensional array of singular values.

getS()

Return the diagonal matrix of singular values.

float
norm2()

Two norm.

float
cond()

Two norm condition number.

int
rank()

Effective numerical matrix rank.

## Details

### at line 65``` __construct(mixed \$Arg) ```

Construct the singular value decomposition.

Derived from LINPACK code.

#### Parameters

 mixed \$Arg Rectangular matrix

### at line 447``` Matrix getU() ```

Return the left singular vectors.

#### Return Value

 Matrix U

### at line 457``` Matrix getV() ```

Return the right singular vectors.

#### Return Value

 Matrix V

### at line 467``` array getSingularValues() ```

Return the one-dimensional array of singular values.

#### Return Value

 array diagonal of S

### at line 477``` Matrix getS() ```

Return the diagonal matrix of singular values.

#### Return Value

 Matrix S

### at line 494``` float norm2() ```

Two norm.

#### Return Value

 float max(S)

### at line 504``` float cond() ```

Two norm condition number.

#### Return Value

 float max(S)/min(S)

### at line 514``` int rank() ```

Effective numerical matrix rank.

#### Return Value

 int Number of nonnegligible singular values