powered by
Returns the original matrix from which the object was constructed or the components of the factorization.
constructX(x) extractL(x) extractU(x)
constructX returns \(\bold{X}\), the original matrix from which the lu
constructX
lu
object was constructed (because of the pivoting the \(\bold{X}\) matrix is not exactly the product between \(\bold{L}\) and \(\bold{U}\)).
extractL returns \(\bold{L}\). This may be pivoted.
extractL
extractU returns \(\bold{U}\).
extractU
object representing an LU factorization. This will typically have come from a previous call to lu.
lu.
a <- matrix(c(10,-3,5,-7,2,-1,0,6,5), ncol = 3) z <- lu(a) L <- extractL(z) L U <- extractU(z) U X <- constructX(z) all(a == X)
Run the code above in your browser using DataLab