1#ifndef LIBSBX_MATH_MATRIX_HPP_
2#define LIBSBX_MATH_MATRIX_HPP_
6#include <libsbx/math/concepts.hpp>
7#include <libsbx/math/vector.hpp>
11template<std::
size_t Columns, std::
size_t Rows, scalar Type>
12requires (Columns > 1u && Rows > 1u)
17 enum class direction : std::uint8_t {
22 inline static constexpr auto columns = Columns;
23 inline static constexpr auto rows = Rows;
25 using value_type = Type;
26 using reference = value_type&;
27 using const_reference =
const value_type&;
28 using size_type = std::size_t;
33 template<scalar Other = value_type>
36 template<scalar Other = value_type>
47 [[nodiscard]]
constexpr auto operator[](size_type index)
noexcept ->
column_type&;
49 [[nodiscard]]
constexpr auto operator[](size_type index)
const noexcept ->
const column_type&;
51 template<scalar Other>
54 template<scalar Other>
57 template<scalar Other>
58 constexpr auto operator*=(Other scalar)
noexcept ->
basic_matrix&;
60 template<scalar Other>
61 constexpr auto operator/=(Other scalar)
noexcept ->
basic_matrix&;
65 constexpr auto data()
noexcept -> value_type* {
66 return _columns[0].data();
69 constexpr auto data()
const noexcept ->
const value_type* {
70 return _columns[0].data();
75 template<scalar Other>
78 template<
typename... Args>
81 constexpr static auto identity(
const value_type value =
static_cast<value_type
>(1))
noexcept ->
basic_matrix;
85 std::array<column_type, Columns> _columns;
89template<std::
size_t Columns, std::
size_t Rows, scalar Lhs, scalar Rhs>
92template<std::
size_t Columns, std::
size_t Rows, scalar Lhs, scalar Rhs>
95template<std::
size_t Columns, std::
size_t Rows, scalar Lhs, scalar Rhs>
98template<std::
size_t Columns, std::
size_t Rows, scalar Lhs, scalar Rhs>
101template<std::
size_t Columns, std::
size_t Rows, scalar Lhs, scalar Rhs>
104template<
typename Matrix>
105[[nodiscard]]
constexpr auto from_array(std::span<typename Matrix::value_type, Matrix::columns * Matrix::rows> array) -> Matrix;
109#include <libsbx/math/matrix.ipp>
Definition: matrix.hpp:13
Definition: vector.hpp:22