Skip to content

allegro0132/grpfc

Repository files navigation

grpfc: Global complex Roots and Poles Finding in C++

GitHub actions PyPI License

A C++ implementation and Python binding of the Global complex Root and Pole Finding (GRPF) algorithm GRPF and SA-GRPF (in-progress).

Description

grpfc attempts to find all the zeros and poles of a complex valued function with complex arguments in a fixed region. These types of problems are frequently encountered in electromagnetics, but the algorithm can also be used for similar problems in e.g. optics, acoustics, etc.

The GRPF algorithm first samples the function on a triangular mesh through Delaunay triangulation. Candidate regions to search for roots and poles are determined and the discretized Cauchy's argument principle is applied without needing the derivative of the function or integration over the contour. To improve the accuracy of the results, a self-adaptive mesh refinement occurs inside the identified candidate regions.

grpfpy: Global complex Roots and Poles Finding binding in Python

We also provide grpfpy, a Python binding for grpfc, which is a convenient and high-performance solution for your research. A set of pre-compiled wheels could be installed directly via

  pip install grpfpy

Additionally, if your platform has not been supported, you can clone the sources and build them yourself using pip or cmake:

  pip install .

Installation

  • Pull source codes
  git clone --recurse-submodules [email protected]:allegro0132/grpfc.git

Linux

  • Install gcc complier
  apt install build-essential

MacOS

  • Install clang compiler
  brew install cmake llvm

Windows

  • Install MinGW gcc compiler
  choco install mingw

Common steps

  • Prepare building directory
  mkdir build&&cd build
  • Prepare compile flags using cmake
  cmake ..

For windows user, you should type it instead:

  cmake -G "MinGW Makefiles" ..
  • Compile the library
  make
  • Run the Roots and Poles solver
  ./main

Citing

Please consider citing following publications if this code is used in scientific work:

  1. P. Kowalczyk, “Complex Root Finding Algorithm Based on Delaunay Triangulation”, ACM Transactions on Mathematical Software, vol. 41, no. 3, art. 19, pp. 1-13, June 2015. https://dl.acm.org/citation.cfm?id=2699457

  2. P. Kowalczyk, "Global Complex Roots and Poles Finding Algorithm Based on Phase Analysis for Propagation and Radiation Problems," IEEE Transactions on Antennas and Propagation, vol. 66, no. 12, pp. 7198-7205, Dec. 2018. https://ieeexplore.ieee.org/document/8457320

  3. S. Dziedziewicz, M. Warecka, R. Lech and P. Kowalczyk, "Self-Adaptive Mesh Generator for Global Complex Roots and Poles Finding Algorithm," in IEEE Transactions on Microwave Theory and Techniques, doi: 10.1109/TMTT.2023.3238014. https://ieeexplore.ieee.org/document/10025853

We also encourage you to cite this package if used in scientific work.

@software{grpfc2025github,
  author = {Ziang Wang},
  title = {{grpfc}: Global complex Roots and Poles Finding in {C++}},
  dol = {10.5281/zenodo.16990552},
  url = {https://github.com/allegro0132/grpfc},
  year = {2025},
}

Related Links

About

C++ implementation and Python binding of the Global complex Root and Pole Finding (GRPF) algorithm.

Resources

License

Stars

Watchers

Forks

Packages

No packages published