Class kde_python (o2scl)¶
-
template<class vec_t = std::vector<double>>
class kde_python : public o2scl::prob_dens_mdim<std::vector<double>>¶ Multidimensional interpolation interface for python.
Public Functions
-
inline kde_python()¶
-
inline kde_python(std::string module, o2scl::tensor<> ¶ms, std::vector<double> array, std::string options = "", std::string class_name = "", int v = 0)¶
Specify the Python module and function.
-
inline virtual ~kde_python()¶
Free memory associated with the KDE.
-
inline void free()¶
Free the associated memory.
-
inline int set_function(std::string module, o2scl::tensor<> ¶ms, std::vector<double> array, std::string options = "", std::string class_name = "", int v = 0)¶
Specify the python and the parameters.
This function is called by the constructor and thus cannot be virtual.
-
inline void *set_function_internal(std::string module, o2scl::tensor<> ¶ms, std::vector<double> array, int &ret, std::string options = "", std::string class_name = "", int v = 0)¶
Internal version of set_function()
-
inline virtual size_t dim() const¶
Return the dimensionality.
-
inline virtual double get_bandwidth() const¶
Get the bandwidth.
Public Members
-
bool array_copy¶
If true, then make a copy of the array before calling log_pdf() (default true)
- Todo:
This should be done by a template specialization instead of a bool flag
-
std::string set_func¶
The name of the set function (default “set_data_str”)
-
std::string sample_func¶
The name of the sample function (default “sample”)
-
std::string ld_func¶
The name of the log pdf function (default “log_pdf”)
Protected Attributes
-
PyObject *p_module¶
Python module containing function.
-
PyObject *p_class¶
The class.
-
PyObject *p_instance¶
An instance of the class.
-
PyObject *p_set_args¶
Function arguments.
-
PyObject *p_ld_args¶
Function arguments.
-
PyObject *p_set_func¶
Python function.
-
PyObject *p_sample_func¶
Python function.
-
PyObject *p_ld_func¶
Python function.
-
size_t n_params¶
Number of parameters.
-
size_t n_points¶
Number of points.
-
inline kde_python()¶