IDS peak ICV v1.0.0
Loading...
Searching...
No Matches
Matrix< Type, rows, columns > Class Template Reference

#include <peak_icv/types/peak_icv_matrix.hpp>

Inheritance diagram for Matrix< Type, rows, columns >:
Collaboration diagram for Matrix< Type, rows, columns >:

Public Member Functions

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.
 

Static Public Member Functions

static Matrix Identity ()
 Creates and returns an identity matrix.
 
static Matrix Diagonal (const Type &value)
 Constructs a uniform diagonal matrix.
 

Detailed Description

template<typename Type, std::size_t rows, std::size_t columns>
class peak::icv::Matrix< Type, rows, columns >

A class template for a two-dimensional matrix.

This class allows for the storage and manipulation of a 2D matrix of a specified type, number of rows, and columns.

Template Parameters
TypeThe type of the elements stored in the matrix.
rowsThe number of rows in the matrix.
columnsThe number of columns in the matrix.
Since
1.0

Definition at line 34 of file peak_icv_matrix.hpp.

Member Function Documentation

◆ At() [1/2]

template<typename Type , std::size_t rows, std::size_t columns>
Type & At ( std::size_t row,
std::size_t col )
inlineconstexprinherited

Accesses the element at the specified row and column.

This method throws an exception if the indices are out of range.

Parameters
rowThe row index of the element to access.
colThe column index of the element to access.
Returns
A reference to the element at the specified indices.
Exceptions
OutOfRangeExceptionIf the row or column index is out of range.
Since
1.0

Definition at line 103 of file peak_icv_array_2d.hpp.

◆ At() [2/2]

template<typename Type , std::size_t rows, std::size_t columns>
const Type & At ( std::size_t row,
std::size_t col ) const
inlineconstexprinherited

Accesses the element at the specified row and column (const version).

This method throws an exception if the indices are out of range.

Parameters
rowThe row index of the element to access.
colThe column index of the element to access.
Returns
A const reference to the element at the specified indices.
Exceptions
OutOfRangeExceptionIf the row or column index is out of range.
Since
1.0

Definition at line 126 of file peak_icv_array_2d.hpp.

◆ begin()

template<typename Type , std::size_t rows, std::size_t columns>
auto begin ( )
inherited

Returns an iterator to the beginning of the array.

Returns
An iterator pointing to the first element of the array.
Since
1.0

Definition at line 212 of file peak_icv_array_2d.hpp.

◆ cbegin()

template<typename T , std::size_t rows, std::size_t columns>
auto cbegin ( ) const
inherited

Returns a const iterator to the beginning of the array.

Returns
An iterator pointing to the first element of the array.

Definition at line 218 of file peak_icv_array_2d.hpp.

◆ cend()

template<typename T , std::size_t rows, std::size_t columns>
auto cend ( ) const
inherited

Returns a const iterator to the end of the array.

Returns
An iterator pointing to one past the last element of the array.

Definition at line 230 of file peak_icv_array_2d.hpp.

◆ Diagonal()

template<typename Type , std::size_t rows, std::size_t columns>
static Matrix Diagonal ( const Type & value)
inlinestatic

Constructs a uniform diagonal matrix.

Parameters
valueThe scalar value to be placed along the diagonal.
Returns
A Matrix with value on the diagonal and zeros elsewhere.
Since
1.0

Definition at line 58 of file peak_icv_matrix.hpp.

◆ end()

template<typename Type , std::size_t rows, std::size_t columns>
auto end ( )
inherited

Returns an iterator to the end of the array.

Returns
An iterator pointing to one past the last element of the array.
Since
1.0

Definition at line 224 of file peak_icv_array_2d.hpp.

◆ GetData()

template<typename Type , std::size_t rows, std::size_t columns>
const Type * GetData ( ) const
inlineconstexprinherited

Returns a pointer to the underlying data of the array.

Returns
A pointer to the array data.
Since
1.0

Definition at line 84 of file peak_icv_array_2d.hpp.

◆ GetNumberOfColumns()

template<typename Type , std::size_t rows, std::size_t columns>
std::size_t GetNumberOfColumns ( ) const
inlineconstexprinherited

Gets the number of columns in the array.

Returns
The number of columns in the array.
Since
1.0

Definition at line 154 of file peak_icv_array_2d.hpp.

◆ GetNumberOfRows()

template<typename Type , std::size_t rows, std::size_t columns>
std::size_t GetNumberOfRows ( ) const
inlineconstexprinherited

Gets the number of rows in the array.

Returns
The number of rows in the array.
Since
1.0

Definition at line 142 of file peak_icv_array_2d.hpp.

◆ Identity()

template<typename Type , std::size_t rows, std::size_t columns>
static Matrix Identity ( )
inlinestatic

Creates and returns an identity matrix.

Since
1.0

Definition at line 44 of file peak_icv_matrix.hpp.