Skip to content

Table

Table<T> is a templated storage container for storing the assorted tabulated data. It can handle any type T of values. Boolean type values internally stored as integers.

The data inside of the Table container is manipulated using a number of dedicated methods:

Constructors

cpp
Table()

Default constructor. Constructs empty table.

cpp
Table(const Table<T>& rhs)

Copy constructor. Initializes current container with a copy of rhs.

cpp
Table(const size_t N, const size_t M)

Constructor. Allocates internal storage to the specified dimensions (N,M).

cpp
void Allocate(const size_t N, const size_t M)

Allocates internal storage to the specified table dimensions (N,M).

cpp
void Reallocate(const size_t N, const size_t M)

Reallocates internal storage to new dimensions (N,M). Previously stored data is erased.

Data access and manipulation

cpp
T const& operator()(const size_t n, const size_t m) const

One-directional access operator. Returns constant reference to the table element (n,m).

cpp
T& operator()(const size_t n, const size_t m)

Bi-directional access operator. Returns reference to the table element (n,m).

cpp
void set(const size_t n, const size_t m, const T value)

Sets Table element (n,m) to the specified value.

cpp
void set_to_value(const T value)

Sets all table elements to the specified value.

cpp
T get(const size_t n, const size_t m) const

Returns the value of Table element (n,m).

cpp
Table<T>& operator=(const Table<T>& rhs)

Assignment operator, assumes equal dimension tables for receiving container and rhs, or empty receiving container which before assignment. Does not check dimensions.

Container properties

cpp
size_t sizeN() const

Returns first dimension of the stored table

cpp
size_t sizeM() const

Returns the second dimension of the stored table.

cpp
bool IsNotAllocated() const

Returns true if Table is not allocated (internal storage size is zero).

cpp
bool IsAllocated() const

Returns true if Table is allocated (internal storage size is not zero).

Released under the GNU GPLv3 License.