|
MADNESS 0.10.1
|
#include <py_functor.h>


Public Member Functions | |
| PyFunctor (py::object f) | |
| ~PyFunctor () | |
| void | operator() (const madness::Vector< double *, 1 > &xvals, T *fvals, int npts) const override |
| void | operator() (const madness::Vector< double *, 2 > &xvals, T *fvals, int npts) const override |
| void | operator() (const madness::Vector< double *, 3 > &xvals, T *fvals, int npts) const override |
| void | operator() (const madness::Vector< double *, 4 > &xvals, T *fvals, int npts) const override |
| void | operator() (const madness::Vector< double *, 5 > &xvals, T *fvals, int npts) const override |
| void | operator() (const madness::Vector< double *, 6 > &xvals, T *fvals, int npts) const override |
| T | operator() (const madness::Vector< double, NDIM > &r) const override |
You should implement this to return f(x) | |
| bool | supports_vectorized () const override |
| Does the interface support a vectorized operator()? | |
Public Member Functions inherited from madness::FunctionFunctorInterface< T, NDIM > | |
| FunctionFunctorInterface () | |
| virtual | ~FunctionFunctorInterface () |
| virtual coeffT | coeff (const keyT &) const |
| virtual bool | provides_coeff () const |
| does this functor directly provide sum coefficients? or only function values? | |
| virtual bool | screened (const Vector< double, NDIM > &c1, const Vector< double, NDIM > &c2) const |
| Can we screen this function based on the bounding box information? | |
| void | set_length_scale (double lo) |
| adapt the special level to resolve the smallest length scale | |
| virtual Level | special_level () const |
| Override this to change the minimum level of refinement at special points (default is 6) | |
| virtual std::vector< Vector< double, NDIM > > | special_points () const |
| Override this to return list of special points to be refined more deeply. | |
| virtual coeffT | values (const keyT &key, const Tensor< double > &tensor) const |
Private Member Functions | |
| void | eval_scalar_loop (const py::array_t< double > &coords, T *fvals, int npts) const |
| Evaluate the callable per-point using scalar convention (still 1 GIL acquisition). | |
| void | eval_vectorized (const madness::Vector< double *, NDIM > &xvals, T *fvals, int npts) const |
Private Attributes | |
| py::object | py_callable_ |
| std::atomic< int > | vectorized_mode_ {0} |
Additional Inherited Members | |
Public Types inherited from madness::FunctionFunctorInterface< T, NDIM > | |
| typedef GenTensor< T > | coeffT |
| typedef Key< NDIM > | keyT |
| typedef T | value_type |
Public Attributes inherited from madness::FunctionFunctorInterface< T, NDIM > | |
| Level | special_level_ |
Wraps a Python callable as a MADNESS FunctionFunctorInterface<T,NDIM>.
Supports two calling conventions:
The vectorized path is always used (supports_vectorized() returns true). On the first batch call, we probe the callable to detect which convention it uses and cache the result.
|
inlineexplicit |
References PyFunctor< T, NDIM >::py_callable_.
|
inlineprivate |
Evaluate the callable per-point using scalar convention (still 1 GIL acquisition).
References d, NDIM, npts, PyFunctor< T, NDIM >::py_callable_, and T().
Referenced by PyFunctor< T, NDIM >::eval_vectorized().
|
inlineprivate |
Core vectorized evaluation: builds numpy array from coordinate pointers, calls the Python callable once, and fills fvals.
References d, PyFunctor< T, NDIM >::eval_scalar_loop(), NDIM, npts, PyFunctor< T, NDIM >::py_callable_, and PyFunctor< T, NDIM >::vectorized_mode_.
Referenced by PyFunctor< T, NDIM >::operator()(), PyFunctor< T, NDIM >::operator()(), PyFunctor< T, NDIM >::operator()(), PyFunctor< T, NDIM >::operator()(), PyFunctor< T, NDIM >::operator()(), and PyFunctor< T, NDIM >::operator()().
|
inlineoverridevirtual |
Reimplemented from madness::FunctionFunctorInterface< T, NDIM >.
References PyFunctor< T, NDIM >::eval_vectorized(), NDIM, and npts.
|
inlineoverridevirtual |
Reimplemented from madness::FunctionFunctorInterface< T, NDIM >.
References PyFunctor< T, NDIM >::eval_vectorized(), NDIM, and npts.
|
inlineoverridevirtual |
Reimplemented from madness::FunctionFunctorInterface< T, NDIM >.
References PyFunctor< T, NDIM >::eval_vectorized(), NDIM, and npts.
|
inlineoverridevirtual |
Reimplemented from madness::FunctionFunctorInterface< T, NDIM >.
References PyFunctor< T, NDIM >::eval_vectorized(), NDIM, and npts.
|
inlineoverridevirtual |
Reimplemented from madness::FunctionFunctorInterface< T, NDIM >.
References PyFunctor< T, NDIM >::eval_vectorized(), NDIM, and npts.
|
inlineoverridevirtual |
Reimplemented from madness::FunctionFunctorInterface< T, NDIM >.
References PyFunctor< T, NDIM >::eval_vectorized(), NDIM, and npts.
|
inlineoverridevirtual |
You should implement this to return f(x)
Implements madness::FunctionFunctorInterface< T, NDIM >.
References NDIM, PyFunctor< T, NDIM >::py_callable_, and T().
|
inlineoverridevirtual |
Does the interface support a vectorized operator()?
Reimplemented from madness::FunctionFunctorInterface< T, NDIM >.
|
mutableprivate |
Referenced by PyFunctor< T, NDIM >::eval_vectorized().