Skip to content

feat(ratf): Added rational functions support and implemented Pade approximation#66

Merged
pasabanov merged 8 commits intomainfrom
pade
Apr 7, 2025
Merged

feat(ratf): Added rational functions support and implemented Pade approximation#66
pasabanov merged 8 commits intomainfrom
pade

Conversation

@pasabanov
Copy link
Copy Markdown
Member

@pasabanov pasabanov commented Apr 7, 2025

Types of changes

  • Feature
  • Documentation
  • Testing
  • Benchmarking

Description

  1. New features:

    • Created file ALFI/ALFI/ratf.h with alfi::ratf namespace for rational functions.
    • Declared RationalFunction type as an alias for std::pair<Container<Number>, Container<Number>>.
    • Added val, val_mul, and val_div functions for scalars and vectors.
    • Implemented pade function for computing Pade approximant about $x = 0$ using extended Euclid algorithm.
  2. New utility functions:

    • Created file ALFI/ALFI/util/poly.h with utility functions for polynomial operations.
    • Implemented normalize, mul, and div functions in alfi::util::poly.
    • Added alfi::util::numeric::binpow function for binary exponentiation.
  3. Added documentation for all new functions and namespaces.

  4. Implemented basic tests and benchmarks for rational functions and Pade approximation.

- Created new file `ALFI/ALFI/ratf.h` with `alfi::ratf` namespace for rational function.
- Implemented a `std::pair`-interchangeable class `RationalFunction`.
- Replaced `RationalFunction` class with an alias for `std::pair<Container<Number>, Container<Number>>`.
- Added `alfi::util::numeric::binpow` function for binary exponentiation.
- Added `val`, `val_mul`, and `val_div` functions in `alfi::ratf` for scalars and vectors.
- Created new file `ALFI/ALFI/util/poly.h` for utility functions for polynomial operations.
- Implemented `normalize`, `mul`, `div`, and `extended_euclid` functions in `alfi::util::poly`.
- Implemented `alfi::ratf::pade` function using `extended_euclid`.
This is done to fix false negative results, for example, with the [2/2] approximation of x^5.
It also simplifies the code and improves performance.
@pasabanov pasabanov added docs Improvements or additions to documentation feature New feature or request tests Adding or changing tests bench Adding or changing benchmarks labels Apr 7, 2025
@pasabanov pasabanov added this to the First Release Version milestone Apr 7, 2025
@pasabanov pasabanov self-assigned this Apr 7, 2025
Comment thread benches/ratf/bench_pade.cpp Fixed
Comment thread benches/ratf/bench_pade.cpp Fixed
Comment thread benches/ratf/bench_pade.cpp Fixed
Comment thread benches/ratf/bench_pade.cpp Fixed
Comment thread benches/ratf/bench_pade.cpp Fixed
Comment thread benches/ratf/bench_pade.cpp Fixed
Comment thread benches/ratf/bench_pade.cpp Fixed
Comment thread benches/ratf/bench_pade.cpp Fixed
Comment thread benches/ratf/bench_pade.cpp Fixed
Comment thread benches/ratf/bench_pade.cpp Fixed
Comment thread benches/ratf/bench_pade.cpp Fixed
Comment thread benches/ratf/bench_pade.cpp Fixed
@pasabanov pasabanov force-pushed the pade branch 4 times, most recently from 7e6f227 to 7577c8f Compare April 7, 2025 17:46
Comment thread benches/ratf/bench_ratf.cpp Dismissed
Comment thread benches/ratf/bench_ratf.cpp Dismissed
Comment thread benches/ratf/bench_ratf.cpp Dismissed
Comment thread benches/ratf/bench_ratf.cpp Dismissed
Comment thread benches/ratf/bench_ratf.cpp Dismissed
Comment thread benches/ratf/bench_ratf.cpp Dismissed
Comment thread benches/ratf/bench_ratf.cpp Dismissed
Comment thread benches/ratf/bench_ratf.cpp Dismissed
Comment thread benches/ratf/bench_ratf.cpp Dismissed
Comment thread benches/ratf/bench_ratf.cpp Dismissed
Comment thread benches/ratf/bench_ratf.cpp Dismissed
Comment thread benches/ratf/bench_ratf.cpp Dismissed
@pasabanov pasabanov merged commit f096773 into main Apr 7, 2025
7 checks passed
@pasabanov pasabanov deleted the pade branch April 7, 2025 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bench Adding or changing benchmarks docs Improvements or additions to documentation feature New feature or request tests Adding or changing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants