Class smooth_func (o2scl)¶
-
template<class
vec_t
, classfunc_t
>
classo2scl
::
smooth_func
¶ Smooth a function by averaging in a neighborhood of points defined by a Sobol sequence.
- Idea for Future:
Move memory allocation outside of 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
-
smooth_func
()¶
-
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.
-
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.