The array2d class is a 2D vector container that may contain elements stored in "host" or "device" memory space.
T | value_type of the array |
MemorySpace | memory space of the array (cusp::host_memory or cusp::device_memory) |
Orientation | orientation of the array (cusp::row_major or cusp::column_major) |
#include <array2d.h>
Public Methods | |
array2d (void) | |
array2d (size_t num_rows, size_t num_cols) | |
array2d (size_t num_rows, size_t num_cols, const ValueType &value) | |
array2d (const size_t num_rows, const size_t num_cols, const ValueType &value, const size_t pitch) | |
template<typename MatrixType > | |
array2d (const MatrixType &matrix) | |
values_array_type::reference | operator() (const size_t i, const size_t j) |
values_array_type::const_reference | operator() (const size_t i, const size_t j) const |
void | resize (const size_t num_rows, const size_t num_cols) |
void | resize (const size_t num_rows, const size_t num_cols, const size_t pitch) |
void | swap (array2d &matrix) |
row_view | row (const size_t i) |
column_view | column (const size_t i) |
const_row_view | row (const size_t i) const |
const_column_view | column (const size_t i) const |
array2d & | operator= (const array2d &matrix) |
template<typename MatrixType > | |
array2d & | operator= (const MatrixType &matrix) |
Public Members | |
size_t | pitch |
values_array_type | values |
|
inline |
|
inline |
|
inline |
cusp::array2d< ValueType, MemorySpace, Orientation >::array2d | ( | const size_t | num_rows, |
const size_t | num_cols, | ||
const ValueType & | value, | ||
const size_t | pitch | ||
) |
This constructor creates a array2d vector with the given shape, fills the entries with a given value and sets the pitch
cusp::array2d< ValueType, MemorySpace, Orientation >::array2d | ( | const MatrixType & | matrix | ) |
column_view cusp::array2d< ValueType, MemorySpace, Orientation >::column | ( | const size_t | i | ) |
This method generates a array1d_view of column i of this array2d matrix
i | The column index used to create array1d_view |
const_column_view cusp::array2d< ValueType, MemorySpace, Orientation >::column | ( | const size_t | i | ) | const |
This method generates a const array1d_view of column i of this array2d matrix
i | The column index used to create array1d_view |
values_array_type::reference cusp::array2d< ValueType, MemorySpace, Orientation >::operator() | ( | const size_t | i, |
const size_t | j | ||
) |
Subscript access to the data contained in this array2d.
i | Row index for which data should be accessed. |
j | Column index for which data should be accessed. |
values_array_type::const_reference cusp::array2d< ValueType, MemorySpace, Orientation >::operator() | ( | const size_t | i, |
const size_t | j | ||
) | const |
Subscript access to the data contained in this array2d.
i | Row index for which data should be accessed. |
j | Column index for which data should be accessed. |
array2d& cusp::array2d< ValueType, MemorySpace, Orientation >::operator= | ( | const array2d< ValueType, MemorySpace, Orientation > & | matrix | ) |
array2d& cusp::array2d< ValueType, MemorySpace, Orientation >::operator= | ( | const MatrixType & | matrix | ) |
Assign operator copies from an exemplar matrix container.
MatrixType | The type of matrix to copy. |
matrix | The matrix to copy. |
void cusp::array2d< ValueType, MemorySpace, Orientation >::resize | ( | const size_t | num_rows, |
const size_t | num_cols | ||
) |
void cusp::array2d< ValueType, MemorySpace, Orientation >::resize | ( | const size_t | num_rows, |
const size_t | num_cols, | ||
const size_t | pitch | ||
) |
row_view cusp::array2d< ValueType, MemorySpace, Orientation >::row | ( | const size_t | i | ) |
This method generates a array1d_view of row i of this array2d matrix
i | The row index used to create array1d_view |
const_row_view cusp::array2d< ValueType, MemorySpace, Orientation >::row | ( | const size_t | i | ) | const |
This method generates a const array1d_view of row i of this array2d matrix
i | The row index used to create array1d_view |
void cusp::array2d< ValueType, MemorySpace, Orientation >::swap | ( | array2d< ValueType, MemorySpace, Orientation > & | matrix | ) |
size_t cusp::array2d< ValueType, MemorySpace, Orientation >::pitch |
values_array_type cusp::array2d< ValueType, MemorySpace, Orientation >::values |