Documentation
|
|
Functions | |
| array | lu (const array &in) |
| LU factorization (packed). More... | |
| void | lu (array &lower, array &upper, const array &in) |
| LU factorization. More... | |
| void | lu (array &lower, array &upper, array &pivot, const array &in) |
| LU factorization (with pivoting). More... | |
| array | qr (const array &in) |
| QR factorization (packed). More... | |
| void | qr (array &q, array &r, const array &in) |
| QR factorization. More... | |
| void | qr (array &q, array &r, array &tau, const array &in) |
QR factorization with tau. More... | |
| array | cholesky (const array &X, bool is_upper=true) |
| Cholesky decomposition ("Y^T * Y == X"). More... | |
| array | cholesky (unsigned &info, const array &X, bool is_upper=true) |
| Cholesky decomposition ("Y^T * Y == X"). More... | |
| array | hessenberg (const array &in) |
| Hessenberg matrix form. More... | |
| void | hessenberg (array &h, array &q, const array &in) |
Hessenberg matrix h with unitary permutation matrix q. More... | |
| array | eigen (const array &in, bool is_diag=false) |
| Compute eigenvalues. More... | |
| void | eigen (array &values, array &vectors, const array &in) |
| Eigenvalues and eigenvectors. More... | |
| array | svd (const array &in, bool is_diag=false) |
| Singular values. More... | |
| void | svd (array &s, array &u, array &v, const array &in) |
| Singular values with unitary bases: in = u * s * v. More... | |
| array af::lu | ( | const array & | in | ) |
LU factorization (packed).
Double-precision or complex values require ArrayFire Pro.
| [in] | in |
| void af::lu | ( | array & | lower, |
| array & | upper, | ||
| const array & | in | ||
| ) |
LU factorization.
Double-precision or complex values require ArrayFire Pro.
| [out] | lower | triangular matrix |
| [out] | upper | triangular matrix |
| [in] | in |
| void af::lu | ( | array & | lower, |
| array & | upper, | ||
| array & | pivot, | ||
| const array & | in | ||
| ) |
LU factorization (with pivoting).
This function decomposes a matrix A as a product of a lower-triangular matrix l and an upper-triangular matrix u. Note that in general, the product of l and u gives us a matrix which is a row-permutation of the original matrix A, obtained by pre-multiplying A with a permutation matrix P.
The following relationship is obtained as a result:
lu = PA
The permutation matrix P is simply a row-permutation of the identity matrix. The location of non-zero entries (1's) in the P matrix can be obtained via a permutation vector p returned by this function, as explained in the code example below.
Double-precision or complex values require ArrayFire Pro.
| [out] | lower | triangular matrix |
| [out] | upper | triangular matrix |
| [out] | pivot | indices |
| [in] | in |
| array af::qr | ( | const array & | in | ) |
QR factorization (packed).
Double-precision or complex values require ArrayFire Pro.
| [in] | in |
| void af::qr | ( | array & | q, |
| array & | r, | ||
| const array & | in | ||
| ) |
QR factorization.
Double-precision or complex values require ArrayFire Pro.
| [out] | q | unitary rotation matrix |
| [out] | r | upper triangular |
| [in] | in |
| void af::qr | ( | array & | q, |
| array & | r, | ||
| array & | tau, | ||
| const array & | in | ||
| ) |
QR factorization with tau.
Double-precision or complex values require ArrayFire Pro.
| [out] | q | orthogonal matrix |
| [out] | r | upper triangular matrix |
| [out] | tau | Additional information about q |
| [in] | in |
| array af::cholesky | ( | const array & | X, |
| bool | is_upper = true |
||
| ) |
Cholesky decomposition ("Y^T * Y == X").
Double-precision or complex values require ArrayFire Pro.
| [in] | X | |
| [in] | is_upper | true for upper triangular solution, false for lower triangular solution |
| array af::cholesky | ( | unsigned & | info, |
| const array & | X, | ||
| bool | is_upper = true |
||
| ) |
Cholesky decomposition ("Y^T * Y == X").
Double-precision or complex values require ArrayFire Pro.
| [out] | info | details on result of decomposition. If successful info is 0 indicating input is positive definite. Else a positive value representing the row at which decomposition failed. |
| [in] | X | |
| [in] | is_upper | true for upper triangular solution, false for lower triangular solution |
| array af::hessenberg | ( | const array & | in | ) |
Hessenberg matrix form.
Double-precision or complex values require ArrayFire Pro.
| [in] | in |
| void af::hessenberg | ( | array & | h, |
| array & | q, | ||
| const array & | in | ||
| ) |
Hessenberg matrix h with unitary permutation matrix q.
such that in = q * h * q^T. Double-precision or complex values require ArrayFire Pro.
| [out] | h | Hessenberg matrix |
| [out] | q | unitary matrix |
| [in] | in |
| array af::eigen | ( | const array & | in, |
| bool | is_diag = false |
||
| ) |
Compute eigenvalues.
Requires ArrayFire Pro.
| [in] | in | |
| [in] | is_diag | true then produce diagonal matrix of eigenvalues, false then vector of eigenvalues |
| void af::eigen | ( | array & | values, |
| array & | vectors, | ||
| const array & | in | ||
| ) |
Eigenvalues and eigenvectors.
Requires ArrayFire Pro.
This function returns eigenvalues and eigenvectors for the input matrix
In the above code example, we obtain three distinct eigenvalues and three distinct eigenvectors, as illustrated in the figure below. As a check, if we pre-multiply each eigenvector with the input matrix, the effect is identical to scaling the eigenvector by a non-zero scalar. This scalar is the associated eigenvalue.
| [out] | values | |
| [out] | vectors | |
| [in] | in |
| array af::svd | ( | const array & | in, |
| bool | is_diag = false |
||
| ) |
Singular values.
Double-precision or complex values require ArrayFire Pro.
| [in] | in | |
| [in] | is_diag | true then produce diagonal matrix of eigenvalues, false then vector of eigenvalues |
| void af::svd | ( | array & | s, |
| array & | u, | ||
| array & | v, | ||
| const array & | in | ||
| ) |
Singular values with unitary bases: in = u * s * v.
Double-precision or complex values require ArrayFire Pro.
| [out] | s | singular values |
| [out] | u | left unitary matrix |
| [out] | v | right unitary matrix |
| [in] | in | The input matrix. |