A container representing a matrix. More...
#include <matrix.hpp>
Public Types | |
using | size_type = std::size_t |
using | value_type = T |
Public Member Functions | |
Element access | |
constexpr vector< T, M > | row (std::size_t i) const |
access specified row More... | |
constexpr vector< T, N > | column (std::size_t i) const |
access specified column More... | |
constexpr T * | operator[] (std::size_t i) |
access specified element More... | |
constexpr T const * | operator[] (std::size_t i) const |
access specified element More... | |
Static Public Attributes | |
static constexpr size_type | column_size = N |
Number of rows. More... | |
static constexpr size_type | row_size = M |
Number of columns. More... | |
Related Functions | |
(Note that these are not member functions.) | |
matrix deduction guides | |
template<typename T , std::size_t M, std::size_t N> | |
matrix (const T(&)[M][N]) -> matrix< T, M, N > | |
deduction guide for aggregate initialization More... | |
Detailed Description
template<typename T, std::size_t N, std::size_t M>
struct nil::crypto3::algebra::matrix< T, N, M >
A container representing a matrix.
- Template Parameters
-
T scalar type to contain N number of rows M number of columns
matrix
is a container representing a matrix. It is an aggregate type containing a single member array of type T[N][M]
which can be initialized with aggregate initialization.
Member Typedef Documentation
◆ size_type
using nil::crypto3::algebra::matrix< T, N, M >::size_type = std::size_t |
◆ value_type
using nil::crypto3::algebra::matrix< T, N, M >::value_type = T |
Member Function Documentation
◆ column()
|
inlineconstexpr |
access specified column
- Parameters
-
i index of the column to extract
- Returns
- the selected row
Extracts a column from the matrix
◆ operator[]() [1/2]
|
inlineconstexpr |
access specified element
- Parameters
-
i index of the row
- Returns
- pointer to the specified row
This function returns a pointer to the specified row. The intention of this function is to then access the specified element from the row pointer. For a matrix m
, accessing the element in the 5th row and 3rd column can be done with m[5][3]
.
◆ operator[]() [2/2]
|
inlineconstexpr |
access specified element
- Parameters
-
i index of the row
- Returns
- pointer to the specified row
This function returns a pointer to the specified row. The intention of this function is to then access the specified element from the row pointer. For a matrix m
, accessing the element in the 5th row and 3rd column can be done with m[5][3]
.
◆ row()
|
inlineconstexpr |
access specified row
- Parameters
-
i index of the row to extract
- Returns
- the selected row
Extracts a row from the matrix.
Member Data Documentation
◆ column_size
|
staticconstexpr |
Number of rows.
◆ row_size
|
staticconstexpr |
Number of columns.
The documentation for this struct was generated from the following file: