#include <memory_manage.h>
◆ PtrGrid() [1/4]
template<size_t ROWS, size_t COLS, class T >
◆ PtrGrid() [2/4]
template<size_t ROWS, size_t COLS, class T >
Create a grid of pointers where each grid cell points to an array of [n_entries]
◆ PtrGrid() [3/4]
template<size_t ROWS, size_t COLS, class T >
PtrGrid< ROWS, COLS, T >::PtrGrid |
( |
size_t |
n_rows, |
|
|
size_t |
n_cols, |
|
|
size_t |
n_entries |
|
) |
| |
|
inline |
Create a grid of pointers with dimensions [ROWS, COLS], where only the grid with dimensions [n_rows, n_cols] has cells pointing to an array of [n_entries]. This can use less memory than a fully-allocated grid.
◆ ~PtrGrid()
template<size_t ROWS, size_t COLS, class T >
◆ PtrGrid() [4/4]
template<size_t ROWS, size_t COLS, class T >
◆ Alloc()
template<size_t ROWS, size_t COLS, class T >
void PtrGrid< ROWS, COLS, T >::Alloc |
( |
size_t |
n_rows, |
|
|
size_t |
n_cols, |
|
|
size_t |
n_entries |
|
) |
| |
|
inline |
Allocate [n_entries] entries per pointer cell.
◆ operator=()
template<size_t ROWS, size_t COLS, class T >
◆ operator[]()
template<size_t ROWS, size_t COLS, class T >
std::array<T*, COLS>& PtrGrid< ROWS, COLS, T >::operator[] |
( |
size_t |
row_idx | ) |
|
|
inline |
◆ RandAllocCxFloat()
template<size_t ROWS, size_t COLS, class T >
void PtrGrid< ROWS, COLS, T >::RandAllocCxFloat |
( |
size_t |
n_entries | ) |
|
|
inline |
Allocate [n_entries] entries per pointer cell. Each entry is a random float between -1.0 and 1.0.
◆ backing_buf_
template<size_t ROWS, size_t COLS, class T >
The pointer cells.
The backing buffer for the per-cell arrays. Having a common buffer reduces the number of memory allocations.
◆ mat_
template<size_t ROWS, size_t COLS, class T >
std::array<std::array<T*, COLS>, ROWS> PtrGrid< ROWS, COLS, T >::mat_ |
|
private |
The documentation for this class was generated from the following file: