summaryrefslogtreecommitdiff
path: root/matching/include/persistence_module.h
diff options
context:
space:
mode:
authorArnur Nigmetov <nigmetov@tugraz.at>2019-12-03 21:14:03 +0100
committerArnur Nigmetov <nigmetov@tugraz.at>2020-02-18 15:02:39 +0100
commit6942d80c4d49239bca9cace9833aa74aee11ddcb (patch)
tree59797321de3b11800de28db8a4dc212828d11844 /matching/include/persistence_module.h
parent919f04a0ad3406b9c02fbce3a9a92c03c9e85c94 (diff)
Add matching distance code.
Diffstat (limited to 'matching/include/persistence_module.h')
-rw-r--r--matching/include/persistence_module.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/matching/include/persistence_module.h b/matching/include/persistence_module.h
new file mode 100644
index 0000000..50ae8d2
--- /dev/null
+++ b/matching/include/persistence_module.h
@@ -0,0 +1,58 @@
+#ifndef MATCHING_DISTANCE_PERSISTENCE_MODULE_H
+#define MATCHING_DISTANCE_PERSISTENCE_MODULE_H
+
+#include <cassert>
+#include <vector>
+#include <utility>
+#include <string>
+
+#include "common_util.h"
+#include "dual_point.h"
+#include "box.h"
+
+namespace md {
+
+ class Relation {
+ public:
+ Relation() {}
+
+ Relation(const Point& _pos)
+ :position_(_pos) { }
+
+ Real get_x() const { return position_.x; }
+
+ Real get_y() const { return position_.y; }
+
+ private:
+ Point position_;
+ };
+
+ class PersistenceModule {
+ public:
+ using Box = md::Box;
+
+ PersistenceModule() { }
+
+ PersistenceModule(const std::string& fname); // read from file
+
+ Diagram slice_diagram(const DualPoint& line);
+
+ Box bounding_box() const;
+
+ private:
+ std::vector<Point> generators_;
+ std::vector<Relation> relations_;
+
+ };
+
+// template<typename R = double>
+// R matching_distance(const PersistenceModule&, const PersistenceModule&, R)
+// {
+// return 0.0;
+// };
+
+} // namespace md
+
+
+
+#endif //MATCHING_DISTANCE_PERSISTENCE_MODULE_H