-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapper.h
63 lines (54 loc) · 1.8 KB
/
Mapper.h
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
59
60
61
62
63
//
// Created by jakob on 26.06.24.
//
#ifndef MAPPER_H
#define MAPPER_H
#include <vector>
#include <memory>
#include "typedefs.h"
#include "DataCover.h"
namespace MapperLib {
class ComplexFactory;
class Complex;
class Clusterer;
class Projection;
/**
* @class Mapper
* @brief class implementing the Mapper algorithm
*
* Mapper is a data visualization algorithm. It takes a point cloud, projects it to a lower dimension, covers
* the remaining space in overlapping hypercubes and clusters the original data in each of these hypercubes.
* Overlapping clusters are now linked by simplices in accordance to the chosen complex.
* The resulting simplicial complex is the output of the algorithm.
*/
class Mapper {
public:
/**
* Create a Mapper algorithm object
* @param data_cover_factory factory creating the data cover to use
* @param complex_factory factory creating the complex to use
* @param clusterer the clustering algorithm to use
* @param projection the projection to use.
*/
Mapper(
std::shared_ptr<DataCoverFactory> data_cover_factory,
std::shared_ptr<ComplexFactory> complex_factory,
std::shared_ptr<Clusterer> clusterer,
std::shared_ptr<Projection> projection
);
/**
* The main method of the Mapper algorithm
* @param data data to apply the mapper algorithm to
* @return the simplicial complex generated by the Mapper algorithm
*/
[[nodiscard]] std::vector<Simplex> map(Matrix const& data) ;
private:
std::shared_ptr<DataCoverFactory> _data_cover_factory;
std::shared_ptr<ComplexFactory> _complex_factory;
std::shared_ptr<Clusterer> _clusterer;
std::shared_ptr<Projection> _projection;
std::unique_ptr<DataCover> _data_cover;
std::unique_ptr<Complex> _complex;
};
} // Mapper
#endif //MAPPER_H