|
protected |
Returns one of the existing row echelon forms of the matrix.
transform_row_params_t... | a template type parameter pack for optional arguments to the method. These arguments are passed to a suitable implementation of the RowEchelonTransformRow function. See details below. |
transform_row_params | is a pack of parameters passed directly to the suitable implementation of the RowEchelonTransformRow function. See details below. |
The function implements variations of the Gaussian elimination algorithm to get the row echelon form. The variation is provided by the RowEchelonTransformRow function which behaves differently depending upon a type (or, to be more precise, upon an algebraic structure that type implements) of a matrix element.
For instance, if given a matrix \(M=\left(\begin{array}{cc} a & b\\ c & d \end{array}\right)\) is defined over Rng, the transformation can be done like the following: \(ref\left(M\right) = {a}^{-1}\cdot\left(\begin{array}{cc} a & b\\ a\cdot c - a\cdot c & a\cdot d - b\cdot c \end{array}\right)\) except that the element \({a}^{-1}\) does not exist in the Rng. Hence, the right part of the above multiplication is taken as a row echelon form, i.e. \(ref\left(M\right)=\left(\begin{array}{cc} a & b \\ a\cdot c - a\cdot c & a\cdot d - b\cdot c\end{array}\right)\). Operations upon elements of the lowest row in the above example are performed by the RowEchelonTransformRow function implemented specifically for value_type
adhering the rng_concept. Since multiplicative inversion is not defined for an Rng, the determinant of the matrix cannot be preserved, and hence the method cannot be used for its calculation. Thus, the optional pack of parameters is not used and ignored by the function.
On the other hand, if multiplicative inversion is defined for matrix elements, i.e. if ones are members of a division ring the same algorithm can be used for calculating both a row echelon form and the determinant of the matrix. Hence, the implementation of the RowEchelonTransformRow function for division rings, and thus corresponding definition of the RowEchelonMe
, expect a pointer, where the the multiplier of the determinant can be written. Therefore, the method definition for division rings will expect an optional pointer, where the multiplicative invertion of the multiplier ( \({{a}^{-1}}^{-1}=a\)) in the above example, can be written. The multiplicative inversion here is caused by compatibility with integral elements, for which division is performed, instead of multiplication to the inversion, which may not exist.
Also, if multiplicative inversion for the elements of a matrix is defined, the Gaussian elimination can be performed as follows: \(M=\left(\begin{array}{cc} a & b\\ c & d \end{array}\right) \to \left(\begin{array}{cc} a & b \\ c - c\cdot\left({a}^{-1}\cdot a\right) & d - c\cdot{a}^{-1}\cdot b \end{array}\right) = \left(\begin{array}{cc} a & b \\ 0 & d-c\cdot{a}^{-1}\cdot b \end{array}\right)\). The determinant of such row echelon form is equal to: \(Det\left(ref\left(M\right)\right)=a\cdot d - a\cdot c\cdot {a}^{-1}\cdot b\). If in addition to multiplicative invertibility multiplication defined over matrix elements is commutative, that is matrix elements appertain to a field, the above expression can be simplified as follows: \(Det\left(ref\left(M\right)\right) = a\cdot d - a\cdot c\cdot {a}^{-1}\cdot b = ad - \left(a\cdot{a}^{-1}\right)\cdot c \cdot b = ab - cd = Det\left(M\right)\).
Hence, for a field the second implementation preserves the determinant of the matrix without exposing the common multiplier, which is the multiplicative identity. Therefore, for fields the second implementation of the RowEchelonTransformRow is used which ignores the parameter pack again.
nullptr
by default.