From 2d38387da92909613b4cf0ecd63c1c8c8ea6f5b0 Mon Sep 17 00:00:00 2001 From: Orange Date: Fri, 12 Jun 2026 01:05:14 +0300 Subject: [PATCH] fix --- include/omath/linear_algebra/mat.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/omath/linear_algebra/mat.hpp b/include/omath/linear_algebra/mat.hpp index fce2acb..f0f8bb4 100644 --- a/include/omath/linear_algebra/mat.hpp +++ b/include/omath/linear_algebra/mat.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #ifdef OMATH_USE_AVX2 @@ -149,7 +150,8 @@ namespace omath } } - [[nodiscard("You must use element reference")]] constexpr Type& at(const size_t row_index, const size_t column_index) + [[nodiscard("You must use element reference")]] constexpr Type& at(const size_t row_index, + const size_t column_index) { return const_cast(std::as_const(*this).at(row_index, column_index)); } @@ -176,6 +178,13 @@ namespace omath operator*(const Mat& other) const { #ifdef OMATH_USE_AVX2 + if (std::is_constant_evaluated()) + { + if constexpr (StoreType == MatStoreType::ROW_MAJOR) + return cache_friendly_multiply_row_major(other); + else if constexpr (StoreType == MatStoreType::COLUMN_MAJOR) + return cache_friendly_multiply_col_major(other); + } if constexpr (StoreType == MatStoreType::ROW_MAJOR) return avx_multiply_row_major(other); else if constexpr (StoreType == MatStoreType::COLUMN_MAJOR)