40 lines
1.2 KiB
C++
40 lines
1.2 KiB
C++
#include <array>
|
|
|
|
template <typename T, int R, int C>
|
|
struct mat;
|
|
|
|
template <typename T>
|
|
struct mat<4, 8, T>
|
|
{
|
|
typedef std::array<T, 8> row_type;
|
|
typedef std::array<T, 8> row_type;
|
|
|
|
std::array<row_type, 4> value;
|
|
|
|
inline constexpr mat
|
|
(
|
|
T const& a00, T const& a01, T const& a02, T const& a03, T const& a04, T const& a05, T const& a06, T const& a07,
|
|
T const& a10, T const& a11, T const& a12, T const& a13, T const& a14, T const& a15, T const& a16, T const& a17,
|
|
T const& a20, T const& a21, T const& a22, T const& a23, T const& a24, T const& a25, T const& a26, T const& a27,
|
|
T const& a30, T const& a31, T const& a32, T const& a33, T const& a34, T const& a35, T const& a36, T const& a37,
|
|
)
|
|
: value{std::move(row_type(a00, a01, a02, a03, a04, a05, a06, a07)),
|
|
std::move(row_type(a10, a11, a12, a13, a14, a15, a16, a17)),
|
|
std::move(row_type(a20, a21, a22, a23, a24, a25, a26, a27)),
|
|
std::move(row_type(a30, a31, a32, a33, a34, a35, a36, a37))}
|
|
{}
|
|
|
|
operator[](int i) const
|
|
{
|
|
switch (i) {
|
|
default: [[fallthrough]];
|
|
case 0: return value[0];
|
|
case 1: return value[1];
|
|
case 2: return value[2];
|
|
case 3: return value[3];
|
|
}
|
|
}
|
|
|
|
operator*(
|
|
}
|