|
noexcept |
Performs an LUP decomposition of a square column-major matrix, constructing the L and U components, as a single matrix, in a buffer and writing the permutation of LU expressed as an array of column indices.
ValueType | A type of a matrix element. |
[in] | column_matrix | A pointer to the square matrix, of n by n elements, to decompose. The matrix is represented by a column-major two-dimensional array of ValueType elements. |
n | A number of columns and a number of rows in the matrix to decompose. | |
[out] | lu | A buffer holding n2 elements of the type ValueType where the unified LU decomposition is assigned to. The LU decomposition assigned to lu is expressed as a single column-major matrix in which lower-left triangular part which includes the main diagonal of lu holds elements of the L component of decomposition, and the upper-right part stores the U component with the main diagonal elements always equal to ValueType(1) and as such not stored explicitly. |
[out] | P | A pointer to a one-dimensional array of indices of columns of the product of the L and U components rearranged as a result of permutation. One can reconstruct the permutation matrix from this array using set_permutation_scaling_matrix or construct_permutation_scaling_matrix. |
The resulting unified matrix is written to lu
using construction of elements it is composed of rather than assignment of those elements. Therefore, no destruction of anything in the buffer pointed to by lu
is performed by the function which considers the memory to be uninitialized. In order to replace old values in lu
rather than construct new ones, use decompose_lup_copy.
To decompose a square matrix in place, use decompose_lup_inplace.
To obtain the decomposition components in an explicit matrix form or to decompose a rectangular matrix, use decompose_lup_explicit_construct.