#include <peak_icv/types/peak_icv_array_2d.hpp>

Public Member Functions | |
| constexpr | Array2D () |
| Default constructor that initializes the array with default values. | |
| constexpr | Array2D (const Type(&initList)[rows][columns]) |
| Constructor that initializes the array with a given 2D initializer list. | |
| constexpr | Array2D (std::array< Type, rows *columns > data) |
| Constructor that initializes the array with a given 1D data array. | |
| constexpr const Type * | GetData () const |
| Returns a pointer to the underlying data of the array. | |
| constexpr Type & | At (std::size_t row, std::size_t col) |
| Accesses the element at the specified row and column. | |
| constexpr const Type & | At (std::size_t row, std::size_t col) const |
| Accesses the element at the specified row and column (const version). | |
| constexpr std::size_t | GetNumberOfRows () const |
| Gets the number of rows in the array. | |
| constexpr std::size_t | GetNumberOfColumns () const |
| Gets the number of columns in the array. | |
| auto | begin () |
| Returns an iterator to the beginning of the array. | |
| auto | cbegin () const |
| Returns a const iterator to the beginning of the array. | |
| auto | end () |
| Returns an iterator to the end of the array. | |
| auto | cend () const |
| Returns a const iterator to the end of the array. | |
A class template for a two-dimensional array.
This class allows for the storage and manipulation of a 2D array of a specified type, number of rows, and columns.
| Type | The type of the elements stored in the array. |
| rows | The number of rows in the array. |
| columns | The number of columns in the array. |
Definition at line 36 of file peak_icv_array_2d.hpp.
|
inlineconstexpr |
Default constructor that initializes the array with default values.
Definition at line 44 of file peak_icv_array_2d.hpp.
|
inlineconstexpr |
Constructor that initializes the array with a given 2D initializer list.
| initList | A 2D array to initialize the Array2D object. |
Definition at line 55 of file peak_icv_array_2d.hpp.
|
inlineexplicitconstexpr |
Constructor that initializes the array with a given 1D data array.
| data | A 1D array to initialize the Array2D object. |
Definition at line 73 of file peak_icv_array_2d.hpp.
|
inlineconstexpr |
Accesses the element at the specified row and column.
This method throws an exception if the indices are out of range.
| row | The row index of the element to access. |
| col | The column index of the element to access. |
| OutOfRangeException | If the row or column index is out of range. |
Definition at line 103 of file peak_icv_array_2d.hpp.
|
inlineconstexpr |
Accesses the element at the specified row and column (const version).
This method throws an exception if the indices are out of range.
| row | The row index of the element to access. |
| col | The column index of the element to access. |
| OutOfRangeException | If the row or column index is out of range. |
Definition at line 126 of file peak_icv_array_2d.hpp.
| auto begin | ( | ) |
Returns an iterator to the beginning of the array.
Definition at line 212 of file peak_icv_array_2d.hpp.
| auto cbegin | ( | ) | const |
Returns a const iterator to the beginning of the array.
Definition at line 218 of file peak_icv_array_2d.hpp.
| auto cend | ( | ) | const |
Returns a const iterator to the end of the array.
Definition at line 230 of file peak_icv_array_2d.hpp.
| auto end | ( | ) |
Returns an iterator to the end of the array.
Definition at line 224 of file peak_icv_array_2d.hpp.
|
inlineconstexpr |
Returns a pointer to the underlying data of the array.
Definition at line 84 of file peak_icv_array_2d.hpp.
|
inlineconstexpr |
Gets the number of columns in the array.
Definition at line 154 of file peak_icv_array_2d.hpp.
|
inlineconstexpr |
Gets the number of rows in the array.
Definition at line 142 of file peak_icv_array_2d.hpp.