diff --git a/include/math/detail/matrix.tpp b/include/math/detail/matrix.tpp index 5b648ab..f2c3c82 100644 --- a/include/math/detail/matrix.tpp +++ b/include/math/detail/matrix.tpp @@ -24,19 +24,19 @@ namespace math::detail{ - template + template constexpr mat_ref_obj::mat_ref_obj(T* d, size_type i): m_data(d+(i*R)){} - template + template constexpr T& mat_ref_obj::operator[](size_type i){ return m_data[i]; } - template + template constexpr const T& mat_ref_obj::operator[](size_type i)const{ return m_data[i]; } - template + template constexpr T determinate_helper::perform(const matrix& m){ T sum = 0; T op = 1; @@ -57,25 +57,25 @@ namespace math::detail{ } return sum; } - template + template constexpr T determinate_helper::perform(const matrix& m){ return (m.get(0) * ((m.get(4) * m.get(8)) - (m.get(5) * m.get(7))) - m.get(1) * ((m.get(3) * m.get(8)) - (m.get(5) * m.get(6))) + m.get(2) * ((m.get(3) * m.get(7)) - (m.get(4) * m.get(6)))); } - template + template constexpr T determinate_helper::perform(const matrix& m){ return m.get(0) * m.get(3) - m.get(1) * m.get(2); } - template + template constexpr matrix inverse_helper::perform(const matrix& m){ T det = m.determinate(); if(!det) return matrix(zero_initialize); return matrix(m.get(3) / det, -(m.get(1)) / det, -(m.get(2)) / det, m.get(0) / det); } - template + template constexpr matrix inverse_helper::perform(const matrix& m){ T det = m.determinate(); if(!det) @@ -90,7 +90,7 @@ namespace math::detail{ -((m.get(0) * m.get(7)) - (m.get(1) * m.get(6))) / det, ((m.get(0) * m.get(4)) - (m.get(1) * m.get(3))) / det); } - template + template constexpr matrix inverse_helper::perform(const matrix& m){ //barely over 50 lines, can be made slightly shorter by making the return statement unreadable T det = m.determinate();