From 93257b1efcc27138a9b69230ecfe462da2ceb572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20L=C3=BCbke?= Date: Mon, 2 Oct 2023 13:19:06 +0200 Subject: [PATCH] add function to return bytes needed for matrix --- matrix.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/matrix.hpp b/matrix.hpp index 20356f5..da56d3d 100644 --- a/matrix.hpp +++ b/matrix.hpp @@ -1,6 +1,7 @@ #ifndef MATRIX_H_ #define MATRIX_H_ +#include #include #include #include @@ -68,6 +69,8 @@ template struct Matrix { constexpr XXH32_hash_t HASH_SEED = 42; return XXH32(this->data.data(), mem.size(), HASH_SEED); } + + std::size_t bytes() const { return this->mem.size() * sizeof(T); } }; template std::ostream &operator<<(std::ostream &os, Matrix &mat) {