Class classify_python (o2scl)

O2scl : Class List

template<class vec_t = boost::numeric::ublas::vector<double>, class vec_int_t = boost::numeric::ublas::vector<int>, class mat_x_t = o2scl::matrix_view_table<>, class mat_y_t = o2scl::matrix_view_table_transpose<>>
class classify_python

Multidimensional interpolation interface for python.

Public Functions

inline classify_python()
inline classify_python(std::string class_name = "", std::string options = "", int v = 0, std::string module_name = "o2sclpy", std::string set_func = "set_data_str", std::string eval_func = "eval")

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 ~classify_python()
inline int set_functions(std::string class_name = "", std::string options = "", int v = 0, std::string s_module = "o2sclpy", std::string set_func = "set_data_str", std::string eval_func = "eval")

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<int> &outputs)

Set the data to be interpolated (tensor form)

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

Compute the function at point x and return the result.

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

Evaluate the interpolation at point x, returning y.

Public Members

bool err_nonconv

If true, throw exceptions on convergence errors (default true)

int verbose

Verbosity parameter (default 0)

Protected Functions

inline void *set_data_internal(size_t n_pars, size_t n_out, size_t n_dat, const o2scl::tensor<> &params, const o2scl::tensor<int> &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

size_t n_params

Number of parameters.

size_t n_outputs

Number of outputs.

size_t n_points

Number of points.

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.

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_class_name

Python class name.

std::string c_options

Python options.

Private Functions

classify_python(const classify_python&)
classify_python &operator=(const classify_python&)