OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
PyPolynomialPatch Namespace Reference

Classes

struct  PyPolynomialPatch
 PyPolynomialMap is the python implementation of the C++ PolynomialMap class. More...
 

Functions

static PyObject * _alloc (PyTypeObject *type, Py_ssize_t nitems)
 _alloc allocates memory for PyPolynomialMap More...
 
static int _init (PyObject *self, PyObject *args, PyObject *kwds)
 _init initialises an allocated PyPolynomialMap object More...
 
static void _dealloc (PyPolynomialMap *self)
 deallocate memory More...
 
static void _free (PyPolynomialMap *self)
 synonym for dealloc More...
 
PyMODINIT_FUNC initsquare_polynomial_map (void)
 Initialise polynomial_map module. More...
 
static PyObject * get_coefficients_as_matrix (PyObject *self, PyObject *args, PyObject *kwds)
 Get the PolynomialMap coefficients. More...
 
static PyObject * evaluate (PyObject *self, PyObject *args, PyObject *kwds)
 Calculate a polynomial vector. More...
 

Class Documentation

◆ PyPolynomialPatch::PyPolynomialPatch

struct PyPolynomialPatch::PyPolynomialPatch

PyPolynomialMap is the python implementation of the C++ PolynomialMap class.

Provides a multivariate polynomial object

Definition at line 35 of file PyPolynomialPatch.h.

Collaboration diagram for PyPolynomialPatch::PyPolynomialPatch:
Collaboration graph
Class Members
PolynomialPatch * map
PyObject_HEAD

Function Documentation

◆ _alloc()

static PyObject * PyPolynomialPatch::_alloc ( PyTypeObject *  type,
Py_ssize_t  nitems 
)
static

_alloc allocates memory for PyPolynomialMap

Parameters
type- pointer to aPyPolynomialMapType object, as defined in PyPolynomialMap.cc

returns a PyPolynomialMap* (cast as a PyObject*); caller owns this memory

◆ _dealloc()

static void PyPolynomialPatch::_dealloc ( PyPolynomialMap *  self)
static

deallocate memory

@params self an initialised PyPolynomialMap*; memory will be freed by this function

◆ _free()

static void PyPolynomialPatch::_free ( PyPolynomialMap *  self)
static

synonym for dealloc

◆ _init()

static int PyPolynomialPatch::_init ( PyObject *  self,
PyObject *  args,
PyObject *  kwds 
)
static

_init initialises an allocated PyPolynomialMap object

Parameters
selfan initialised PyPolynomialMap* cast as a PyObject*; caller owns this memory
argsnot used
kwdsnot used
Returns
0 on success; -1 on failure

◆ evaluate()

static PyObject * PyPolynomialPatch::evaluate ( PyObject *  self,
PyObject *  args,
PyObject *  kwds 
)
static

Calculate a polynomial vector.

Parameters
selfa PyPolynomialMap
argsarguments to the function (not used)
kwdskeyword arguments to the function - see docstring
Returns
a PyList of floats with ValueDimension

Referenced by Attributes::getBool(), Expressions::SRefAttr< T >::getReal(), Attributes::getReal(), Attributes::getRealArray(), Attributes::getString(), Attributes::getStringArray(), Attributes::getTokenList(), Attributes::getTokenListArray(), Attributes::StringArray::parseComponent(), Attributes::TokenListArray::parseComponent(), and Attributes::UpperCaseStringArray::parseComponent().

◆ get_coefficients_as_matrix()

static PyObject * PyPolynomialPatch::get_coefficients_as_matrix ( PyObject *  self,
PyObject *  args,
PyObject *  kwds 
)
static

Get the PolynomialMap coefficients.

Parameters
selfa PyPolynomialMap
argsarguments to the function (not used)
kwdskeyword arguments to the function - see docstring
Returns
a list of lists of floats; each corresponding to a value in the polynomial map

◆ initsquare_polynomial_map()

PyMODINIT_FUNC PyPolynomialPatch::initsquare_polynomial_map ( void  )

Initialise polynomial_map module.

This is called by import polynomial_map; it initialises the PolynomialMap type allowing user to construct and call methods on PolynomialMap objects