Add Grid::fill()

This commit is contained in:
Stefan Müller 2025-01-21 14:00:38 +01:00
parent ab7aa394dc
commit ae99d41cf4
1 changed files with 8 additions and 0 deletions

View File

@ -53,6 +53,14 @@ class Grid
{ {
return rowNo * nColumns_ + data_.get(); return rowNo * nColumns_ + data_.get();
} }
void fill(const T value)
{
for (size_t i = 0; i < nRows_ * nColumns_; i++)
{
data_[i] = value;
}
}
private: private:
size_t nRows_; size_t nRows_;
size_t nColumns_; size_t nColumns_;