12#include "detray/algebra/generic/algorithms/matrix/inverse/hard_coded.hpp"
13#include "detray/algebra/generic/impl/generic_matrix.hpp"
14#include "detray/algebra/generic/impl/generic_vector.hpp"
15#include "detray/algebra/type_traits.hpp"
16#include "detray/algebra/utils/approximately_equal.hpp"
17#include "detray/definitions/detail/qualifiers.hpp"
24namespace detray::algebra::generic::math {
27template <concepts::index index_t, concepts::scalar scalar_t,
28 template <
typename, index_t, index_t>
class matrix_t,
29 template <
typename, index_t>
class array_t>
47 using vector2 = detray::traits::get_vector_t<matrix44, 2, scalar_t>;
49 using vector3 = detray::traits::get_vector_t<matrix44, 3, scalar_t>;
66 template <concepts::scalar o_scalar_t>
74 generic::math::identity<matrix44>()};
77 generic::math::identity<matrix44>()};
94 const vector3 &
z,
bool get_inverse =
true) {
127 bool get_inverse =
true)
171 if constexpr (std::floating_point<scalar_type>) {
173 auto prod = generic::math::zero<matrix44>();
177 for (index_t i = 0; i < 4; ++i) {
178 for (index_t j = 0; j < 4; ++j) {
179 for (index_t k = 0; k < 4; ++k) {
180 elem(prod, k, j) += elem(m, k, i) * elem(m_inv, i, j);
185 [[maybe_unused]]
constexpr auto epsilon{
186 std::numeric_limits<scalar_type>::epsilon()};
187 assert(algebra::approx_equal(prod, generic::math::identity<matrix44>(),
188 16.f * epsilon, 1e-6f));
222 for (index_t j = 0; j < 4; j++) {
224 for (index_t i = 0; i < 3; i++) {
Definition concepts.hpp:86
"inverse getter", assuming a N X N matrix
Definition hard_coded.hpp:24