ppmd.host module

class ppmd.host.Array(initial_value=None, name=None, ncomp=1, dtype=<class 'ctypes.c_double'>)

Bases: ppmd.host._Array

Basic dynamic memory array on host, with some methods.

property ctype
property ctypes_data
ctypes_data_access(mode=Read and write., pair=False)
ctypes_data_post(mode=Read and write.)
property dtype
property end

Returns end index of array.

inc_version(inc=1)

Increment the version by the specified amount :param int inc: amount to increment version by.

property ncomp
realloc(length)
property size
property version

Get the version of this array. :return int version:

zero()
class ppmd.host.Matrix(nrow=1, ncol=1, initial_value=None, dtype=<class 'ctypes.c_double'>)

Bases: object

Basic dynamic memory matrix on host, with some methods.

property ctype
property ctypes_data
ctypes_data_access(mode=Read and write., pair=False)
Parameters

mode (access) – Access type required by the calling method.

Returns

The pointer to the data.

ctypes_data_post(mode=Read and write.)
property data
property dtype
inc_version(inc=1)

Increment the version by the specified amount :param int inc: amount to increment version by.

property ncol
property nrow
realloc(nrow, ncol)
property size
property version

Get the version of this array. :return int version:

zero()
class ppmd.host.ThreadSpace(n, dtype)

Bases: object

property ctypes_data
ppmd.host.available_free_memory()

Get available free memory in bytes. :return: Free memory in bytes.

ppmd.host.null_matrix(dtype)

Return a Null*Matrix based on passed type. :param dtype: Data type of Null matrix. :return: Null Matrix.

ppmd.host.pointer_offset(ptr=None, offset=0)

Add offset number of bytes to pointer ptr, returns ctypes void ptr :param ptr: original pointer :param offset: offset in bytes