18 static constexpr matrix<T, N>
zero()
24 static constexpr matrix<T, N>
iden()
27 for(std::size_t i = 0; i < N; i++)
29 ret.mat[i * N + i] = T{1};
35 static constexpr matrix<T, N>
filled(T t)
38 std::fill(ret.mat.begin(), ret.mat.end(), t);
48 const T& operator[](std::size_t idx)
const;
49 T& operator[](std::size_t idx);
51 const T& operator()(std::size_t x, std::size_t y)
const;
52 T& operator()(std::size_t x, std::size_t y);
60 matrix<T, N>& operator+=(T scalar);
61 matrix<T, N> operator+(T scalar)
const{
auto cpy = *
this;
return cpy += scalar;}
63 matrix<T, N> operator-(T scalar)
const{
auto cpy = *
this;
return cpy -= scalar;}
64 matrix<T, N>& operator*=(T scalar);
65 matrix<T, N> operator*(T scalar)
const{
auto cpy = *
this;
return cpy *= scalar;}
66 matrix<T, N>& operator/=(T scalar);
67 matrix<T, N> operator/(T scalar)
const{
auto cpy = *
this;
return cpy /= scalar;}
70 matrix<T, N>& operator*=(
const matrix<T, N>& rhs);
71 matrix<T, N> operator*(
const matrix<T, N>& rhs)
const{
auto cpy = *
this;
return cpy *= rhs;}
73 bool operator==(
const matrix<T, N>& rhs)
const =
default;
76 std::array<T, N*N> mat;