From 6a1c6f50ca64163fc904c5b6e6e13a9bed559c6a Mon Sep 17 00:00:00 2001 From: Sresht Date: Wed, 8 Apr 2026 18:41:52 +0530 Subject: [PATCH] added boolean helpers to check buffer state --- src/Vectorial.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Vectorial.h b/src/Vectorial.h index 5551e95..e6b6703 100644 --- a/src/Vectorial.h +++ b/src/Vectorial.h @@ -19,6 +19,18 @@ struct Vector { } } + // checks if buffer is empty + + bool is_empty() { + return entriesAdded == 0; + } + + // checks if buffer is full + + bool is_full() { + return entriesAdded == N; + } + T operator[](int idx) const { return data[(entriesAdded - 1 - idx + 2*N) % N]; }