Exercise "QR-decomposition"

To work with matrices you can use (apart from creating your own structures): For QR-factorization you have the following choices:
  1. (6 points)
  2. (3 points)
    Compare the speed of your QR-routine with a library routine, e.g. by aplying them to random matrices of different sizes.

    Hint: the total number of CPU-seconds used by a program my_prog can be determined by the POSIX time utility. The command

    
    \time --format "time = %U" --append --output=time.txt ./my_prog > /dev/null 
    
    or, in short
    
    \time -f "%U" -ao time.txt ./my_prog > /dev/null 
    
    runs the program (disregarding the standard output) and appends the number of consumed CPU-seconds to the file time.txt. Without the --append (or, in short, -a) option the file time.txt gets overwritten. Backslash here is needed to run the actual utility rather than built-in bash command (with similar possibilities, actually).

    An example of the usage of time can be found here (see the makefile).

  3. (1 point) Check that the time to perform a QR-decomposition of an (n rows)x(m cols) matrix scales as mn2.
  4. (0 points) Implement LU-decomposition and back-substitution.