aboutsummaryrefslogtreecommitdiff
path: root/src/data_cell.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/data_cell.h')
-rw-r--r--src/data_cell.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/data_cell.h b/src/data_cell.h
new file mode 100644
index 0000000..fbb5dfb
--- /dev/null
+++ b/src/data_cell.h
@@ -0,0 +1,23 @@
+#pragma once
+
+#include "vector.h"
+
+struct DataCell {
+ double data[3][3];
+
+ inline double& get(int x, int y) {
+ return data[1+x][1-y];
+ }
+
+ inline double& get(Vector<int> v) {
+ return get(v[0], v[1]);
+ }
+
+ inline double get(int x, int y) const {
+ return data[1+x][1-y];
+ }
+
+ inline double get(Vector<int> v) const {
+ return get(v[0], v[1]);
+ }
+};