Performs an LUP decomposition of a column-major matrix and constructs the three results in three separate buffers.
- Template Parameters
-
ValueType | A type of a matrix element. |
- Parameters
-
[in] | column_matrix | A pointer to the matrix to decompose. The matrix is represented by a column-major two-dimensional array of ValueType elements. |
| columns | A number of columns in the matrix to decompose. |
| rows | A number of rows in the matrix to decompose. |
[out] | L | A buffer of columns by rows elements which accept the lower-triangular component of the decomposition. |
[out] | U | A pointer to a square matrix, of columns by columns elements, where the upper-triangular component of the decomposition is constructed. The main diagonal of the U component always contains multiplicative identities, ValueType(1) , on output. |
[out] | P | A pointer to a square matrix, of columns by columns elements, where the permutation matrix is constructed. |
- Returns
- Properties of the LUP-decomposition defined as a bitmask of the LU_status enumeration type. If the result signals singularity, then only the
L
component will be singular. Neither the upper, U
, component not the permutation matrix will be singular.
The resulting matrices, L
, U
and P
, are constructed in, rather than assigned-to, buffers pointed to by, respectively, L
, U
and P
. Therefore, no destruction of anything in the buffers is performed by the function which considers memory addressed by L
, U
and P
to be uninitialized. In order to replace old values in L
, U
and P
, rather than construct new ones, use decompose_lup_explicit_copy.
The function assumes the following preconditions are met:
Rows(L) == Rows(column_matrix)
;
Columns(L) == Rows(U) == Columns(U) == Rows(P) == Columns(P) == Columns(column_matrix)
, where Rows(X)
and Columns(X)
are respectively the numbers of rows and columns the matrix/buffer X
holds/capable of holding. - See also
- decompose_lup_construct, decompose_lup_inplace.