Update grid dimensions validation to handle 1D grids

This commit is contained in:
Max Lübke 2024-03-27 20:11:45 +00:00
parent 1679dc84d2
commit 8c0687a6cd

View File

@ -57,9 +57,9 @@ public:
*/
Grid(int _row, int _col)
: row(_row), col(_col), domainRow(_row), domainCol(_col) {
if (row <= 3 || col <= 3) {
if (row <= 1 || col <= 1) {
throw std::invalid_argument(
"Given grid dimensions too small. Must each be greater than 3.");
"At least one dimension is 1. Use 1D grid for better results.");
}
this->dim = 2;