Class interpm_python (o2scl)

O2scl : Class List

template<class vec_t = boost::numeric::ublas::vector<double>, class mat_x_t = o2scl::matrix_view_table<>, class mat_y_t = o2scl::matrix_view_table_transpose<>>
class interpm_python : public o2scl::interpm_base<boost::numeric::ublas::vector<double>, o2scl::matrix_view_table<>, o2scl::matrix_view_table_transpose<>>

Multidimensional interpolation interface for python.

Public Functions

inline interpm_python()
inline interpm_python(std::string module, std::string set_func, std::string eval_func, std::string eval_unc_func, std::string class_name = "", std::string options = "", int v = 0)

Specify the Python module and function.

inline void free()

Free memory associated with the Python objects and the interpolation.

Note

This function does not finalize the Python interface.

inline virtual ~interpm_python()
inline int set_functions(std::string s_module, std::string set_func, std::string eval_func, std::string eval_unc_func, std::string class_name = "", std::string options = "", int v = 0)

Specify the python module, class, functions, and options.

inline virtual int set_data(size_t n_in, size_t n_out, size_t n_pts, mat_x_t &user_x, mat_y_t &user_y)

Set the data to be interpolated.

inline int set_data_tensor(size_t n_in, size_t n_out, size_t n_pts, const o2scl::tensor<> &params, const o2scl::tensor<> &outputs)

Set the data to be interpolated (tensor form)

inline int eval_std_vec(const std::vector<double> &x, std::vector<double> &y) const

Compute the function at point x and return the result.

inline int eval_unc_std_vec(const std::vector<double> &x, std::vector<double> &y, std::vector<double> &y_unc) const

Compute the function at point x and return the result.

inline virtual int eval(const vec_t &x, vec_t &y) const

Evaluate the interpolation at point x, returning y.

inline virtual int eval_unc(const vec_t &x, vec_t &y, vec_t &y_unc) const

Evaluate the interpolation at point x, returning y and the uncertainties in y_unc.

Protected Functions

inline void *set_data_internal(size_t n_pars, size_t n_dat, size_t n_out, const o2scl::tensor<> &params, const o2scl::tensor<> &outputs, int &ret)

The internal set data function.

Note

This function returns a void pointer to be compatible with the Python import_array() macro.

Protected Attributes

PyObject *p_module

Python module.

PyObject *p_class

Python class.

PyObject *p_instance

An instance of the Python class.

PyObject *p_set_args

Python function arguments for the set function.

PyObject *p_eval_args

Python function arguments for the evaluation function.

PyObject *p_set_func

Python set function.

PyObject *p_eval_func

Python evaluation function.

PyObject *p_eval_unc_func

Python evaluation with uncertainties function.

std::string c_module

Name of Python module.

std::string c_set_func

Name of Python set function.

std::string c_eval_func

Name of Python eval function.

std::string c_eval_unc_func

Name of Python evaluation with uncertainties function.

std::string c_class_name

Python class name.

std::string c_options

Python options.

Private Functions

interpm_python(const interpm_python&)
interpm_python &operator=(const interpm_python&)