Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hardcode3/polynomialtools
A basic C++ tool to solve polynomials of n'th order (companion matrix) -> with unit tests /!\ Eigen3 lib
https://github.com/hardcode3/polynomialtools
cmake eigen3 mathematics polynomials resolution
Last synced: 14 days ago
JSON representation
A basic C++ tool to solve polynomials of n'th order (companion matrix) -> with unit tests /!\ Eigen3 lib
- Host: GitHub
- URL: https://github.com/hardcode3/polynomialtools
- Owner: Hardcode3
- License: mit
- Created: 2023-07-23T16:05:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-12T16:54:51.000Z (over 1 year ago)
- Last Synced: 2024-11-23T13:20:34.676Z (3 months ago)
- Topics: cmake, eigen3, mathematics, polynomials, resolution
- Language: C++
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PolynomialTools
## DescriptionA simple C++ / CMake project to deal with n'th order polynomial resolution and other simple polynomial operations.
The project is currently under development and is delivered with unit tests.
The main feature is the resolution of polynomials of degree n by using the method of the companion matrix applied to its monic form. The eigen values of this matrix correspond to its roots and both real and imaginary roots are found by using this method.
Depending on the needs, you can pick real, imaginary of every roots of the polynomial.
This resolution can be useful in many topics of applied mathematics.Results have been compared to numpy.roots() function from matplotlib (python library), giving the exact same output.
## Dependencies
The dependency is limited to the library [Eigen3](https://eigen.tuxfamily.org/index.php?title=Main_Page)
## Installation
In order to use the library:
- Embed the needed files in your project
- Or clone the whole project as a git submodule in your existing projectEigen can be:
- An existing target in your host repository
- An external target (vcpkg...)
- A local target created by cloning the repository when setting the flag POLYNOMIALS_CLONE_SUBMODULE_EIGEN to ONYou are free to chose the intergration in your project.
FindPackage is not suported on this library.
## Sources
The algorithm has been writen using:
- The [Wikipedia page](https://en.wikipedia.org/wiki/Companion_matrix)
- [R. A. Horn & C. R. Johnson, Matrix Analysis. Cambridge, UK: Cambridge University Press, 1999, pp. 146-7.](https://anandinstitute.org/pdf/Roger_A.Horn.%20_Matrix_Analysis_2nd_edition(BookSee.org).pdf)