Perform LU decomposition. More...
Functions | |
AFAPI void | lu (array &out, array &pivot, const array &in, const bool is_lapack_piv=true) |
C++ Interface to perform LU decomposition in packed format. More... | |
AFAPI void | lu (array &lower, array &upper, array &pivot, const array &in) |
C++ Interface to perform LU decomposition. More... | |
AFAPI void | luInPlace (array &pivot, array &in, const bool is_lapack_piv=true) |
C++ Interface to perform in-place LU decomposition. More... | |
AFAPI af_err | af_lu (af_array *lower, af_array *upper, af_array *pivot, const af_array in) |
C Interface to perform LU decomposition. More... | |
AFAPI af_err | af_lu_inplace (af_array *pivot, af_array in, const bool is_lapack_piv) |
C Interface to perform in-place LU decomposition. More... | |
Perform LU decomposition.
This function decomposes input matrix \(A\) into a lower triangle \(L\), an upper triangle \(U\) such that \(A = L * U\).
For stability, a permutation array \(P\) is also used to modify the formula in the following manner, \(A(P, span) = L * U\).
This operation can be performed in ArrayFire, using the following code snippet.
The permuted version of the original matrix can be reconstructed, using the following snippet.
The sample output for these operations can be seen below.
When memory is a concern, users can perform the LU decomposition in place as shown below.
The lower and upper triangle matrices can be obtained if necessary in the following manner.
LU decompositions have many applications including solving a system of linear equations. Check af::solveLU for more information.
C Interface to perform LU decomposition.
[out] | lower | lower triangular matrix of the LU decomposition |
[out] | upper | upper triangular matrix of the LU decomposition |
[out] | pivot | permutation indices mapping the input to the decomposition |
[in] | in | input array |
C Interface to perform in-place LU decomposition.
This function is not supported in GFOR.
[out] | pivot | permutation indices mapping the input to the decomposition |
[in,out] | in | input array on entry; packed LU decomposition on exit |
[in] | is_lapack_piv | specifies if the pivot is returned in original LAPACK-compliant format |
C++ Interface to perform LU decomposition.
This function is not supported in GFOR.
[out] | lower | lower triangular matrix of the LU decomposition |
[out] | upper | upper triangular matrix of the LU decomposition |
[out] | pivot | permutation indices mapping the input to the decomposition |
[in] | in | input array |
C++ Interface to perform LU decomposition in packed format.
This function is not supported in GFOR.
[out] | out | packed LU decomposition |
[out] | pivot | permutation indices mapping the input to the decomposition |
[in] | in | input array |
[in] | is_lapack_piv | specifies if the pivot is returned in original LAPACK compliant format |
C++ Interface to perform in-place LU decomposition.
This function is not supported in GFOR.
[out] | pivot | permutation indices mapping the input to the decomposition |
[in,out] | in | input array on entry; packed LU decomposition on exit |
[in] | is_lapack_piv | specifies if the pivot is returned in original LAPACK-compliant format |