A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://arrayfire.org/docs/group__lapack__factor__func__svd.htm below:

ArrayFire: svd

Perform singular value decomposition. More...

AFAPI void  svd (array &u, array &s, array &vt, const array &in)   C++ Interface to perform singular value decomposition. More...
  AFAPI void  svdInPlace (array &u, array &s, array &vt, array &in)   C++ Interface to perform in-place singular value decomposition. More...
  AFAPI af_err  af_svd (af_array *u, af_array *s, af_array *vt, const af_array in)   C Interface to perform singular value decomposition. More...
  AFAPI af_err  af_svd_inplace (af_array *u, af_array *s, af_array *vt, af_array in)   C Interface to perform in-place singular value decomposition. More...
 

Perform singular value decomposition.

This function factorizes a matrix \(A\) into two unitary matrices, \(U\) and \(V^T\), and a diagonal matrix \(S\), such that \(A = USV^T\). If \(A\) has \(M\) rows and \(N\) columns ( \(M \times N\)), then \(U\) will be \(M \times M\), \(V\) will be \(N \times N\), and \(S\) will be \(M \times N\). However, for \(S\), this function only returns the non-zero diagonal elements as a sorted (in descending order) 1D array.

To reconstruct the original matrix \(A\) from the individual factors, the following code snippet can be used:

array U, S, Vt;

const int MN = std::min(M, N);

array UU = U(span, seq(MN));

array SS = diag(S, 0,

false

).

as

(ty);

array VV = Vt(seq(MN), span);

array AA = matmul(UU, SS, VV);

const array as(dtype type) const

Casts the array into another data type.

AFAPI void svd(array &u, array &s, array &vt, const array &in)

C++ Interface to perform singular value decomposition.

When memory is a concern, and \(A\) is dispensable, af::svdInPlace() can be used. However, this in-place version is currently limited to input arrays where \(M \geq N\).

◆ af_svd()

C Interface to perform singular value decomposition.

Parameters
[out] u U [out] s diagonal values of sigma (singular values of the input matrix) [out] vt V^H [in] in input array
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given
◆ af_svd_inplace()

C Interface to perform in-place singular value decomposition.

This function minimizes memory usage if in is dispensable. Input array in is limited to arrays where dim0 \(\geq\) dim1.

Parameters
[out] u U [out] s diagonal values of sigma (singular values of the input matrix) [out] vt V^H [in,out] in input array; contains random data after the operation this operation
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given
◆ svd()

C++ Interface to perform singular value decomposition.

Parameters
[out] u U [out] s diagonal values of sigma (singular values of the input matrix) [out] vt V^H [in] in input array
◆ svdInPlace()

C++ Interface to perform in-place singular value decomposition.

This function minimizes memory usage if in is dispensable. Input array in is limited to arrays where dim0 \(\geq\) dim1.

Parameters
[out] u U [out] s diagonal values of sigma (singular values of the input matrix) [out] vt V^H [in,out] in input array; contains random data after the operation this operation

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4