From c45bca2e0bdb33f8805b4d277f4655d84bf60d5b Mon Sep 17 00:00:00 2001 From: Orange Date: Sat, 19 Oct 2024 17:16:45 +0300 Subject: [PATCH] fix --- include/omath/Mat.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/include/omath/Mat.h b/include/omath/Mat.h index 6d8385d..e20410e 100644 --- a/include/omath/Mat.h +++ b/include/omath/Mat.h @@ -2,6 +2,7 @@ // Created by vlad on 9/29/2024. // #pragma once +#include #include #include #include @@ -59,13 +60,13 @@ namespace omath } [[nodiscard]] - static constexpr size_t RowCount() noexcept { return Rows; } + static consteval size_t RowCount() noexcept { return Rows; } [[nodiscard]] - static constexpr size_t ColumnsCount() noexcept { return Columns; } + static consteval size_t ColumnsCount() noexcept { return Columns; } [[nodiscard]] - static constexpr std::pair Size() noexcept { return { Rows, Columns }; } + static consteval std::pair Size() noexcept { return { Rows, Columns }; } [[nodiscard]] constexpr const float& At(const size_t rowIndex, const size_t columnIndex) const @@ -92,11 +93,13 @@ namespace omath constexpr void Clear() { - for (size_t i = 0; i < Rows; ++i) - for (size_t j = 0; j < Columns; ++j) - At(i, j) = 0.f; + Set(0.f); } + constexpr void Set(const float value) + { + std::ranges::fill(m_data, value); + } // Operator overloading for multiplication with another Mat template constexpr Mat operator*(const Mat& other) const