◆ newton
Callable object computing the newton operation: \(\sum_{i = 0}^n c_i\prod_{j = 0}^i (x-n_i)\). Required header: Members Functions
auto operator()(value x, std::inputiterator auto firstcoef, std::inputiterator auto sentinel, std::inputiterator auto firstnode) const noexcept;
Definition: value.hpp:31 Parameters
Return value Returns elementwise the value of polynomial function(s) represented in newton form by the coefficients and the nodes. The result type is of the compatibility type of the coefficients and the evaluation value
auto operator[]( conditional_expression auto cond ) const noexcept;
Higher-order function generating a masked version of eve::newton Parameters
Return value A Callable object so that the expression Supported decorators
ExampleSee it live on Compiler Explorer #include <eve/function/newton.hpp>
#include <eve/wide.hpp>
#include <iostream>
#include <list>
#include <vector>
using wide_ft = eve::wide<float, eve::fixed<4>>;
using wide_it = eve::wide<int , eve::fixed<8>>;
int main()
{
wide_ft xd = {-0.3, 0.5, 0.0, 2.0};
wide_ft x(0.5);
std::vector<float> v {1, -2, 3, -4};
std::list<float> l {1, -2, 3, -4};
std::vector<float> n {1, 2, 6};
std::vector<wide_ft> wv { {0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11} };
std::cout << "---- simd" << '\n'
<< "<- xd = " << xd << '\n'
<< "<- x = " << x << '\n'
<< "<- l and v contain {1, -2, 3, -4} "<< '\n'
<< "<- n contains { 1, 2, 6} "<< '\n'
<< "<- wv contains { {0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11} }"<< '\n'
return 0;
}
constexpr callable_newton_ newton Callable object computing the newton operation: . Definition: newton.hpp:14 |