Transform Triangular Matrices from Unit Triangular to General Triangular and Back
Transform Triangular Matrices from Unit Triangular to General Triangular and Back
Transform a triangular matrix x, i.e., of class
triangularMatrix, from (internally!) unit triangular (unitriangular ) to general triangular (diagU2N(x)) or back (diagN2U(x)). Note that the latter, diagN2U(x), also sets the diagonal to one in cases where diag(x) was not all one.
.diagU2N(x) and .diagN2U(x) assume without
checking that x is a triangularMatrix with suitable diag slot ("U" and "N", respectively), hence they should be used with care.
cl: (optional, for speedup only:) class (definition) of x.
checkDense: logical indicating if dense (see denseMatrix) matrices should be considered at all; i.e., when false, as per default, the result will be sparse even when x is dense.
Details
The concept of unit triangular matrices with a diag slot of "U" stems from LAPACK.
Note
Such internal storage details should rarely be of relevance to the user. Hence, these functions really are rather internal
utilities.
Returns
a triangular matrix of the same class but with a different diag slot. For diagU2N (semantically) with identical entries as x, whereas in diagN2U(x), the off-diagonal entries are unchanged and the diagonal is set to all 1 even if it was not previously.