Exercise "QR-decomposition"

Objective: solve a system of linear equations by QR-decomposition and back-substitution; calculate the absolute value of the determinant of a matrix; calculate the matrix inverse.
  1. Implement a function which, given a matrix A, calculates its QR-decomposition by modified Gram-Schmidt orthogonalization.
  2. Implement a function which, given the matrices Q and R from the QR-decomposition and the vector b of the right-hand-sides, solves the system of linear equations Ax=b by back-substitution.
  3. Implement a function which, given the matrices Q and R from the QR-decomposition, calculates the (absolute value of the) determinant of matrix A.
  4. Implement a function which, given the matrices Q and R from the QR-decomposition of a matrix A, calculates its inverse.