summaryrefslogtreecommitdiff
path: root/matching/include/persistence_module.h
blob: 50ae8d2a9e6c28456d53dac76e05bbec8f8b6619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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