9#include "numerical_differentiation.h"
78type NumericalDifferentiation::calculate_eta()
const
89 const type eta = calculate_eta();
91 return sqrt(eta)*(
static_cast<type
>(1.0) +
abs(x));
100 const type eta = calculate_eta();
102 const Index n = x.size();
104 Tensor<type, 1> h(n);
106 for(Index i = 0; i < n; i++)
108 h(i) = sqrt(eta)*(type(1) +
abs(x(i)));
120 const type eta = calculate_eta();
122 const Index n = x.size();
124 const auto& dimensions = x.dimensions();
126 Tensor<type, 2> h(dimensions);
128 Tensor<type, 2> y = x.abs();
130 for(Index i = 0; i < n; i++)
132 h(i) = sqrt(eta)*(type(1) + y(i));
141 const type eta = calculate_eta();
143 const Index n = x.size();
145 const auto& dimensions = x.dimensions();
147 Tensor<type, 4> h(dimensions);
149 Tensor<type, 4> y = x.abs();
151 for(Index i = 0; i < n; i++)
153 h(i) = sqrt(eta)*(type(1) + y(i));
const Index & get_precision_digits() const
Enumeration of available methods for numerical differentiation.
type calculate_h(const type &) const
const bool & get_display() const
Returns the flag used by this class for displaying or not displaying warnings.
bool display
Flag for displaying warning messages from this class.
Index precision_digits
Number of precision digits.
void set_display(const bool &)
virtual ~NumericalDifferentiation()
Destructor.
NumericalDifferentiation()
void set_precision_digits(const Index &)
HALF_CONSTEXPR half abs(half arg)