template<typename T>
Matrix2 class

Constructors, destructors, conversion operators

Matrix2(size_t rows, size_t cols)

Public functions

auto operator[](size_t i) -> std::vector<T>&
auto operator[](size_t i) const -> const std::vector<T>&
auto rows() const -> size_t
auto cols() const -> size_t
auto operator*(const Vector2<T>& v) const -> Vector2<T>

Function documentation

template<typename T>
Matrix2<T>::Matrix2(size_t rows, size_t cols)

Parameters
rows The number of rows in the Matrix2.
cols The number of columns in the Matrix2.

Constructs a new Matrix2 with the specified number of rows and columns, initializing all elements to the default value of type T.

template<typename T>
std::vector<T>& Matrix2<T>::operator[](size_t i)

Parameters
i The row index to access.
Returns A reference to the vector of elements at the specified row index.

Returns a reference to the vector of elements at the specified row index.

template<typename T>
const std::vector<T>& Matrix2<T>::operator[](size_t i) const

Parameters
i The row index to access.
Returns A constant reference to the vector of elements at the specified row index.

Returns a constant reference to the vector of elements at the specified row index.

template<typename T>
size_t Matrix2<T>::rows() const

Returns The number of rows in the Matrix2.

Returns the number of rows in the Matrix2.

template<typename T>
size_t Matrix2<T>::cols() const

Returns The number of columns in the Matrix2.

Returns the number of columns in the Matrix2.

template<typename T>
Vector2<T> Matrix2<T>::operator*(const Vector2<T>& v) const

Parameters
v The Vector2 to multiply by the elements of this Matrix2.
Returns The resulting Vector2 after the multiplication.

Multiplies the given Vector2 by the elements of this Matrix2.