The repository contains a set of challenges to be solved using knowledge of numerical linear algebra and the famous linear algebra library: Eigen. In addition, the use of LIS (Library of Iterative Solvers for Linear Systems) has been adopted to solve some eigenvalue problems. The two challenges are developed using the C++ programming language.
The challenges are part of the Numerical Linear Algebra course at the Politecnico di Milano.
The challenges are divided into two main categories:
- Challenge 1. Apply image filters and find the approximate solution of a linear system to process a grayscale image.
- Challenge 2. Apply Singular Value Decomposition (SVD) for image compression and noise reduction.
Each folder contains a README that explains each challenge in more detail.
Eigen and LIS libraries are required to run the code. The code has been tested on Linux OS, therefore we don't guarantee that it will run correctly.
- Eigen doesn't have any dependencies other than the C++ standard library. It is a pure template library defined in the headers. The repository contains all the releases.
- Installing Lis requires a C compiler. More information can be found on the official website.
If you are a student at the Politecnico di Milano, you can easily use the MK Library (provided by the MOX Laboratory) to compile the code.
In the CMakeLists.txt file, you can find the following lines that include the MK library:
include_directories(
/u/sw/toolchains/gcc-glibc/11.2.0/base/include
/u/sw/toolchains/gcc-glibc/11.2.0/pkgs/eigen/3.3.9/include/eigen3
/u/sw/toolchains/gcc-glibc/11.2.0/pkgs/lis/2.0.30/include
/u/sw/toolchains/gcc-glibc/11.2.0/pkgs/dealii/9.5.1/include
)
If you don't want to use the MK library, you can comment out the lines containing the MK library.
If you have CLion installed, this is a simple story. Just open the project and run the code using the provided CMakeLists.txt file. On the right side of the CLion window you can see the available executables.
Otherwise, you can compile the code using the command line.
- Compile the CMakeFiles:
After running the above command, you will see the Makefile in the repository folder. This Makefile contains the necessary commands to compile the code. Since the Makefile is generated automatically, you don't need to edit it. If you want to edit the Makefile, you can do so by modifying the file CMakeLists.txt.
cd NLA-challenges # repository folder cmake . # where the CMakeLists.txt file is located
- Compile all possible executables with the following command:
# assuming you are in the repository folder where the CMakeLists.txt file is located make -f ./Makefile -C . all
- And finally, run one of the compiled codes:
# assuming you are in the repository folder where the CMakeLists.txt file is located ./challenge_1-main # and ./challenge_2-main
- Clean the compiled files:
# assuming you are in the repository folder where the CMakeLists.txt file is located make -f ./Makefile -C . clean