Skip to content

Minard-Jules/NAFPack

Repository files navigation

NAFPack - Numerical Analysis in Fortran Package

Logo NAFPack

NAFPack is a Fortran-based numerical analysis package, offering a comprehensive set of algorithms for diverse numerical computations. These computations include Fast Fourier Transform, linear system solving, and eigenvalue/eigenvector calculations.

Table of Contents

Features

NAFPack incorporates the following numerical analysis algorithms:

  • Fast Fourier Transform (FFT): Implementation of the Cooley-Tukey FFT algorithm and integration with the FFTW library for signal processing and frequency domain analysis.

  • Linear System Solvers: Comprehensive implementations of various methods for solving linear systems, including Gaussian elimination, LU decomposition, and iterative methods like Gauss Seidel.

  • Eigenvalue and Eigenvector Computations: Algorithms designed to find eigenvalues and eigenvectors of matrices, such as the power iteration method and the QR algorithm.

Compilation

Ensure you have CMake, FFTW, fpm and Fortran Compiler (e.g. gfortran) installed.

  1. Linux (Debian/Ubuntu)

    $ sudo apt-get update
    $ sudo apt-get install gfortran cmake pkg-config libfftw3-dev
    # Install fpm
    $ curl -Lo fpm https://github.com/fortran-lang/fpm/releases/download/fpm-linux-x86_64
    $ chmod +x fpm
    $ sudo mv fpm /usr/local/bin
  2. Windows (MSYS2)

    Download and execute the MSYS2 installer, then update MSYS2 as explained on the site MSYS2

    Note: All commands must be run from the MSYS2 MinGW terminal

    • Build tools (gfortran, python, make, pkgconf, ...): 
    $ pacman -S mingw-w64-ucrt-x86_64-toolchain base-devel
    • CMake:
    $ pacman -S mingw-w64-ucrt-x86_64-cmake
    • FFTW:
    $ pacman -S mingw-w64-ucrt-x86_64-fftw
    • fpm:
    $ pacman -S mingw-w64-ucrt-x86_64-fpm

Using CMake

  1. Create a build directory:

    $ mkdir build && cd build
  2. Run CMake to generate build files:

    • Linux
    $ cmake ..
    • Windows
    $ cmake -G "MSYS Makefiles" ..
  3.  Compile the project with make :

    $ make
  4. Run the tests:

    $ ctest

Using Fortran Package Manager (fpm)

  1. Build the project:

    $ fpm build
  2. Run the tests:

    $ fpm test
  3. If you use conda environments with windows, you need to specify the path to the fftw library:

    $ fpm test --link-flag "-L$env:CONDA_PREFIX/Library/bin"

Getting Started

  • To integrate NAFPack into your project, you can use the Fortran Package Manager fpm.

    In your fpm.toml file, add the following dependency:

    [dependencies]
    NAFPack = { git = "https://github.com/Minard-Jules/NAFPack.git" }

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

About

Numerical Analysis in Fortran Package

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages