←to practical programming

Problems "GSL-matrix"

If you wish, you can build the latest version of GSL on your box from its git repository:
sudo apt install autoconf automake libtool
cd ~/local
git clone https://git.savannah.gnu.org/git/gsl.git
cd gsl
sh autoconf.sh  # and install what is missing
sh configure    # and install what is missing
make --jobs=3
make --jobs=3 check
sudo make install # installs in /usr/local by default
# you might want to add /usr/local/lib to your /etc/ld.so.conf
  1. (Mandatory) Consider the following system of linear equations in the matrix form,
    [ 6.13 -2.90 5.86 ] [x0] [6.23]
    [ 8.08 -6.31 -3.89 ] [x1] = [5.37]
    [ -4.36 1.00 0.19 ] [x2] [2.29]
    1. Solve it using GSL's [Householder solver for linear systems].

    2. Check that you have the correct solution by multiplying the original matrix (you need to save a copy of it as the routine destroys the matrix it is given) and the solution and comparing with the right-hand-side.
  2. (Optional) Compute the eigenvalues and eigenvectors of 4-th order Hilbert matrix, Hij = 1/(i + j + 1).