![]() |
Fréchet View
1.6.0
A Tool for Exploring Fréchet Distance Algorithms
|
memory pool for matrix objects (M4RI matrices mzd_t* and OpenCL matrices clm4rm_t*)
Keeps a list of recycled objects to reduce the need for new memory allocations. During the course of the poly-algorithm, all matrixes have similar sizes, so the chances for reusability are very good.
Definition at line 26 of file matrix_pool.h.
#include <matrix_pool.h>
Public Member Functions | |
MatrixPool () | |
empty constructor More... | |
~MatrixPool () | |
destructor; releases all resources More... | |
mzd_t * | new_mzd_t (int rows, int cols) |
allocate a new mzd_t structure (a matrix for the M4RI algorithms) More... | |
clmatrix_t * | new_clmatrix_t (int rows, int cols, clm4rm_conditions *cond) |
allocate a new clmatrix_t structure (a matrix for the CLM4RM algorithms) More... | |
void | reclaim (mzd_t *) |
reclaim an object (i.e. put it into the recycling list) More... | |
void | reclaim (clmatrix_t *) |
reclaim an object (i.e. put it into the recycling list) More... | |
void | clear () |
release all resources More... | |
Private Types | |
typedef std::pair< int, int > | Key |
typedef std::list< mzd_t * > | mzdList |
typedef std::list< clmatrix_t * > | clmatrixList |
typedef boost::unordered_map< Key, mzdList > | mzdMap |
typedef boost::unordered_map< Key, clmatrixList > | clmatrixMap |
Private Member Functions | |
mzdList & | getMzdFreeList (int rows, int cols) |
clmatrixList & | getClmatrixFreeList (int rows, int cols) |
Private Attributes | |
mzdMap | free_mzd |
set of recyclable mzd_t objects More... | |
clmatrixMap | free_clmatrix |
set of recyclable clmatrix_t objects More... | |
|
private |
Definition at line 30 of file matrix_pool.h.
|
private |
Definition at line 33 of file matrix_pool.h.
|
private |
Definition at line 28 of file matrix_pool.h.
|
private |
Definition at line 29 of file matrix_pool.h.
|
private |
Definition at line 32 of file matrix_pool.h.
MatrixPool::MatrixPool | ( | ) |
empty constructor
Definition at line 19 of file matrix_pool.cpp.
MatrixPool::~MatrixPool | ( | ) |
destructor; releases all resources
Definition at line 23 of file matrix_pool.cpp.
void MatrixPool::clear | ( | ) |
release all resources
Definition at line 94 of file matrix_pool.cpp.
|
private |
Definition at line 36 of file matrix_pool.cpp.
|
private |
Definition at line 27 of file matrix_pool.cpp.
clmatrix_t * MatrixPool::new_clmatrix_t | ( | int | rows, |
int | cols, | ||
clm4rm_conditions * | cond | ||
) |
allocate a new clmatrix_t structure (a matrix for the CLM4RM algorithms)
rows | number of matrix rows |
cols | number of matrix columns |
cond | clm4rm_conditions keeps track of OpenCL working queue |
Definition at line 66 of file matrix_pool.cpp.
mzd_t * MatrixPool::new_mzd_t | ( | int | rows, |
int | cols | ||
) |
allocate a new mzd_t structure (a matrix for the M4RI algorithms)
rows | number of matrix rows |
cols | number of matrix columns |
Definition at line 46 of file matrix_pool.cpp.
void MatrixPool::reclaim | ( | mzd_t * | M | ) |
reclaim an object (i.e. put it into the recycling list)
Definition at line 84 of file matrix_pool.cpp.
void MatrixPool::reclaim | ( | clmatrix_t * | M | ) |
reclaim an object (i.e. put it into the recycling list)
Definition at line 89 of file matrix_pool.cpp.
|
private |
set of recyclable clmatrix_t objects
Definition at line 38 of file matrix_pool.h.
|
private |
set of recyclable mzd_t objects
Definition at line 36 of file matrix_pool.h.