summaryrefslogtreecommitdiff
path: root/lib/include/wolff/models/height.hpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-17 19:33:25 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-17 19:33:25 -0400
commitf2f7a072216dfafab89851e4ff3e0b2c3eb16663 (patch)
treef9c7e1e4e91ce8b0ec9cef9f2423029fe7b7f049 /lib/include/wolff/models/height.hpp
parent1343a3fe6bd17a2487f12a0d61be8dc83cd722a0 (diff)
downloadc++-f2f7a072216dfafab89851e4ff3e0b2c3eb16663.tar.gz
c++-f2f7a072216dfafab89851e4ff3e0b2c3eb16663.tar.bz2
c++-f2f7a072216dfafab89851e4ff3e0b2c3eb16663.zip
removed a lot of research code to simplify library and examples for publication
Diffstat (limited to 'lib/include/wolff/models/height.hpp')
-rw-r--r--lib/include/wolff/models/height.hpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/include/wolff/models/height.hpp b/lib/include/wolff/models/height.hpp
new file mode 100644
index 0000000..bd0ceb6
--- /dev/null
+++ b/lib/include/wolff/models/height.hpp
@@ -0,0 +1,43 @@
+
+#pragma once
+
+#include <cmath>
+#include <wolff/types.h>
+
+template <class T>
+struct height_t {
+ T x;
+
+ height_t() : x(0) {}
+ height_t(T x) : x(x) {}
+
+ typedef T M_t;
+ typedef double F_t;
+
+ inline T operator*(v_t a) const {
+ return x * a;
+ }
+
+ inline double operator*(double a) const {
+ return x * a;
+ }
+
+ inline T operator-(const height_t& h) const {
+ return x - h.x;
+ }
+};
+
+template <class T>
+inline T& operator+=(T& M, const height_t<T> &h) {
+ M += h.x;
+
+ return M;
+}
+
+template <class T>
+inline T& operator-=(T& M, const height_t<T> &h) {
+ M -= h.x;
+
+ return M;
+}
+