AMCAX Kernel 1.0.0.0
|
Template class of two dimensional array. More...
#include <common/Array2.hpp>
Public Types | |
using | value_type = T |
Type of value. | |
Public Member Functions | |
Array2 () noexcept=default | |
Default constructor. | |
Array2 (int nrow, int ncol) | |
Construct an nrow x ncol array. More... | |
Array2 (int nrow, int ncol, const T &initvalue) | |
Construct an array with an initial value. More... | |
~Array2 () noexcept | |
Destructor. | |
Array2 (const Array2 &other) | |
Copy constructor. More... | |
Array2 (Array2 &&other) noexcept | |
Move constructor. More... | |
Array2 & | operator= (const Array2 &other) |
Copy assignment operator. More... | |
Array2 & | operator= (Array2 &&other) noexcept |
Move assignement operator. More... | |
T * | Data () noexcept |
Get the raw data pointer. More... | |
const T * | Data () const noexcept |
Get the constant raw data pointer. More... | |
bool | Empty () const noexcept |
Is the array empty. More... | |
void | Clear () noexcept |
Clear the array. | |
int | Size () const noexcept |
Get the total number of elements. More... | |
int | NRow () const noexcept |
Get the number of rows. More... | |
int | NCol () const noexcept |
Get the number of columns. More... | |
const T & | operator() (int i, int j) const |
Get the element by indices. More... | |
T & | operator() (int i, int j) |
Get the element by indices. More... | |
void | Resize (int row, int col) |
Resize the array. More... | |
void | Assign (int row, int col, const T &value) |
Assign the array with a value. More... | |
void | Row (int i, std::vector< T > &data) const |
Get the row of given index. More... | |
void | Col (int j, std::vector< T > &data) const |
Get the column of given index. More... | |
std::vector< T > | Row (int i) const |
Get the row of given index. More... | |
std::vector< T > | Col (int j) const |
Get the column of given index. More... | |
void | FillRow (int i, const std::vector< T > &data) |
Fill the row of given index with given data. More... | |
void | FillCol (int j, const std::vector< T > &data) |
Fill the column of given index with given data. More... | |
Template class of two dimensional array.
T | Type of element |
|
inline |
Construct an nrow x ncol array.
nrow | The number of rows |
ncol | The number of columns |
|
inline |
Construct an array with an initial value.
nrow | The number of rows |
ncol | The number of columns |
initvalue | The initial value |
|
inline |
Copy constructor.
other | The other array |
|
inlinenoexcept |
Move constructor.
other | The other array |
|
inline |
Assign the array with a value.
row | The new number of rows |
col | The new number of columns |
value | The value |
|
inline |
Get the column of given index.
j | The index of column |
|
inline |
Get the column of given index.
[in] | j | The index of column |
[out] | data | The column data |
|
inlinenoexcept |
Get the constant raw data pointer.
|
inlinenoexcept |
Get the raw data pointer.
|
inlinenoexcept |
Is the array empty.
|
inline |
Fill the column of given index with given data.
j | The index of column |
data | The column data |
|
inline |
Fill the row of given index with given data.
i | The index of row |
data | The row data |
|
inlinenoexcept |
Get the number of columns.
|
inlinenoexcept |
Get the number of rows.
|
inline |
Get the element by indices.
i | The row index |
j | The column index |
|
inline |
Get the element by indices.
i | The row index |
j | The column index |
|
inlinenoexcept |
Move assignement operator.
other | The other array |
|
inline |
Copy assignment operator.
other | The other array |
|
inline |
Resize the array.
row | New number of rows |
col | New number of columns |
|
inline |
Get the row of given index.
i | The index of row |
|
inline |
Get the row of given index.
[in] | i | The index of row |
[out] | data | The row data |
|
inlinenoexcept |
Get the total number of elements.