Version 0.55.1

svd

Performs a singular value decomposition of a matrix.

Signatures

  •   svd( matrix matA, matrix& matU, matrix& matW, matrix& matV )

Details

Applies a singular value decomposition to the matrix. This means, that the given matrix A is expressed in the form

A = U * W * VT

with matrices U, W and V. Matrix W is diagonal and contains the singular values as diagonal elements.

Example

 matrix A = <[ <[ 1, 2, 3 ]>,
               <[ 4, 5, 6 ]>,
               <[ 7, 8, 9 ]> ]>
 matrix U
 matrix W
 matrix V
 svd( A, U, W, V )

 echo( U * W * V.t() )
 

Output

 <[<[1,2,3]>,<[4,5,6]>,<[7,8,9]>]>
 

Parameters

matA

The input matrix A.

matU

Returns the matrix U.

matW

Returns the matrix W.

matV

Returns the matrix V.

🗙

Search results for