MLIB
|
Polynomial evaluation using Horner's scheme. More...
#include <array>
#include <vector>
Go to the source code of this file.
Functions | |
template<typename T > | |
T | mlib::poly (T x, const T *coeff, int n) |
Evaluate a polynomial using Horner's scheme. | |
template<typename T , size_t N> | |
T | mlib::poly (T x, std::array< T, N > coeff) |
Evaluate a polynomial using Horner's scheme. | |
template<typename T > | |
T | mlib::poly (T x, std::vector< T > coeff) |
Evaluate a polynomial using Horner's scheme. | |
Polynomial evaluation using Horner's scheme.
(c) Mircea Neacsu 2020
T mlib::poly | ( | T | x, |
const T * | coeff, | ||
int | n | ||
) |
Evaluate a polynomial using Horner's scheme.
x | Evaluation point |
coeff | polynomial coefficients in order from lowest power (coeff[0]) to highest power (coeff[N-1]) |
n | size of coefficient's array. |
T mlib::poly | ( | T | x, |
std::array< T, N > | coeff | ||
) |
Evaluate a polynomial using Horner's scheme.
x | Evaluation point |
coeff | array of polynomial coefficients in order from lowest power (coeff[0]) to highest power (coeff[N-1]) |
This template function will generate a new instantiation for each array size.
T mlib::poly | ( | T | x, |
std::vector< T > | coeff | ||
) |
Evaluate a polynomial using Horner's scheme.
x | Evaluation point |
coeff | vector of polynomial coefficients in order from lowest power (coeff[0]) to highest power (coeff[N-1]) |