Class smooth_func (o2scl)¶
-
template<class vec_t, class func_t>
class smooth_func¶ Smooth a function by averaging in a neighborhood of points defined by a Sobol sequence.
Todo
Future: Move memory allocation outside of ref o2scl::smooth_func::operator()() .
Warning
The function o2scl::smooth_func::set_func() stores a pointer to the function specified by the user, so the user must ensure that this pointer is still valid when o2scl::smooth_func::operator()() is called.
Public Functions
-
inline smooth_func()¶
-
inline void set_n(size_t n_new)¶
Set the number of points to use in the average.
If
n_new
is zero then the error handler will be called.
-
inline int operator()(size_t nv, const vec_t &x, vec_t &y)¶
Evaluate the smoothed function.
If the user-specified function returns a non-zero value for any point, then that contribution to the average is ignored. This function will return a non-zero value if the user-specified function returns a non-zero value for all of the points.
-
inline smooth_func()¶