6 template <
size_t a,
size_t b, Primitive T>
7 template <
size_t c,
size_t d, Primitive P>
10 for (
size_t i = 0; i < a; i++)
12 for (
size_t j = 0; j < b; j++)
14 arr[i * b + j].set_ptr(p.data[i][j]);
18 template <
size_t a,
size_t b, Primitive T>
19 template <
size_t c,
size_t d, Primitive P>
22 for (
size_t i = 0; i < a; i++)
24 for (
size_t j = 0; j < b; j++)
26 arr[i * b + j].set_ptr(p.arr[i * b + j]);
31 template <
size_t a,
size_t b, Primitive T>
35 for (
size_t i = 0; i < a; i++)
42 template <
size_t a,
size_t b, Primitive T>
46 for (
size_t i = 0; i < a; i++)
53 template <
size_t a,
size_t b, Primitive T>
56 for (
size_t i = 0; i < size.x; i++)
60 for (
size_t i = 0; i < a && i < b; i++)
66 template <
size_t a,
size_t b, Primitive T>
72 template <
size_t a,
size_t b, Primitive T>
79 template <
size_t a,
size_t b, Primitive T>
85 template <
size_t a,
size_t b, Primitive T>
89 for (
size_t i = 0; i < size.x; i++)
91 return_value.
data[i] = -data[i];
96 template <
size_t a,
size_t b, Primitive T>
97 template <Primitive U>
100 for (
size_t i = 0; i < size.x; i++)
102 data[i] += other.
data[i];
106 template <
size_t a,
size_t b, Primitive T>
107 template <Primitive U>
110 for (
size_t i = 0; i < size.x; i++)
112 data[i] -= other.
data[i];
117 template <
size_t a,
size_t b, Primitive T>
118 template <
size_t c, Primitive U>
121 return (*
this = *
this * other);
123 template <
size_t a,
size_t b, Primitive T>
124 template <Primitive U>
127 for (
size_t i = 0; i < size.x; i++)
129 data[i] += other.
data[i];
133 template <
size_t a,
size_t b, Primitive T>
134 template <Primitive U>
137 for (
size_t i = 0; i < size.x; i++)
139 data[i] -= other.
data[i];
144 template <
size_t a,
size_t b, Primitive T>
145 template <
size_t c, Primitive U>
148 return (*
this = *
this * other);
151 template <
size_t a,
size_t b, Primitive T>
152 template <Primitive U>
155 for (
size_t i = 0; i < size.x; i++)
161 template <
size_t a,
size_t b, Primitive T>
162 template <Primitive U>
165 for (
size_t i = 0; i < size.x; i++)
171 template <
size_t a,
size_t b, Primitive T>
172 template <Primitive U>
175 for (
size_t i = 0; i < size.x; i++)
Contains mathematical utility functions and classes.
Specialized representation of matrices using reference semantics.
Internal detail definition of a reference vector with fixed size L and type T
Definition of matrix with dimensions rows x columns and type T
std::array< vec< size.y, T >, size.x > data
2D array (rows x columns) representation of matrix data.
Definition of a reference matrix with dimensions rows x columns and type T
constexpr void reset() noexcept
Resets all elements to zero.
constexpr mat< a, b, T > operator-() const noexcept
Unary minus operator, returns negated matrix.
std::array< _detail::rvec< size.y, T >, size.x > data
2D representation of the matrix.
constexpr rmat< a, b, T > & operator+=(rmat< a, b, U > const &other)
Adds another reference matrix of the same size to this matrix.
constexpr rmat< a, c, T > & operator*=(rmat< b, c, U > const &other)
Matrix multiplication with another reference matrix.
constexpr rmat< a, b, T > & operator-=(rmat< a, b, U > const &other)
Subtracts another reference matrix of the same size from this matrix.
constexpr rmat()
Default constructor.
constexpr _detail::rvec< b, T > & operator[](size_t i)
Indexing operator to access rows.
constexpr rmat< a, b, T > const & operator+() const noexcept
Unary plus operator, returns the matrix itself.
constexpr rmat< a, b, T > & operator=(mat< a, b, U > const &mat)
Assigns values from a matrix of the same size.