Defined in header <scicpp/polynomials.hpp>
Evaluate a polynomial at points x.
Evaluate a polynomial with coefficients defined in a std::array.
Evaluate a polynomial with coefficients defined in a std::vector.
InputIt, class OutputIt, class Coeffs>polyval(InputIt xfirst, InputIt xlast, OutputIt res_first, const Coeffs &coeffs)¶Evaluate a polynomial over an iterator range.
The memory pointed by res_first must be allocated with appropriate size before calling the function.
| Parameters: | |
|---|---|
| xfirst: | First point of the range. |
| xlast: | Last point of the range. |
| res_first: | First point where the evaluation results are stored. |
| coeffs: | An array containing the polynomial coefficients (std::array or std::vector) |
T, std::size_t M, class Coeffs>polyval(const std::array<T, M> &x, const Coeffs &coeffs)¶Evaluate a polynomial over a std::array.
| Parameters: | |
|---|---|
| x: | The std::array of points to be evaluated. |
| coeffs: | An array containing the polynomial coefficients (std::array or std::vector) |
T, class Coeffs>polyval(const std::vector<T> &x, const Coeffs &coeffs)¶Evaluate a polynomial over a std::vector.
| Parameters: | |
|---|---|
| x: | The std::vector of points to be evaluated. |
| coeffs: | An array containing the polynomial coefficients (std::array or std::vector) |