Skip to content

University project of the Numerical Linear Algebra course. There are two challenges solved using NLA knowledge and two famous library: Eigen and LIS.

Notifications You must be signed in to change notification settings

PoliMI-HPC-E-notes-projects-AndreVale69/NLA-challenges

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Numerical Linear Algebra challenges

Description

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:

Each folder contains a README that explains each challenge in more detail.


How to run the code

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.

  1. Compile the CMakeFiles:
    cd NLA-challenges # repository folder
    cmake . # where the CMakeLists.txt file is located
    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.
  2. 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
  3. 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
  4. Clean the compiled files:
    # assuming you are in the repository folder where the CMakeLists.txt file is located
    make -f ./Makefile -C . clean

About

University project of the Numerical Linear Algebra course. There are two challenges solved using NLA knowledge and two famous library: Eigen and LIS.

Topics

Resources

Stars

Watchers

Forks

Languages