-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshift_endo.cpp
More file actions
43 lines (32 loc) · 1.34 KB
/
shift_endo.cpp
File metadata and controls
43 lines (32 loc) · 1.34 KB
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
#include "grlina/homomorphisms.hpp"
#include "grlina/r2graded_matrix.hpp"
#include <grlina/graded_linalg.hpp>
#include <iostream>
#include <filesystem>
using namespace graded_linalg;
void endomorphism_sizes(std::filesystem::path input_path) {
R2GradedSparseMatrix<int> presentation = R2GradedSparseMatrix<int>(input_path.string());
std::cout << presentation.get_num_rows() << " x " << presentation.get_num_cols() << std::endl;
for(int i = 0; i < 5; ++i) {
double eps = 0.005 * i;
auto pres_shift = presentation;
presentation.sort_columns_lexicographically();
presentation.sort_rows_lexicographically();
pres_shift.shift({eps, eps});
presentation.compute_rows_forward();
auto endos = hom_space_basis_new(presentation, pres_shift, true);
std::cout << "Epsilon: " << eps << " Number of endomorphisms: " << endos.size() << std::endl;
}
}
int main(int argc, char** argv) {
std::string filepath;
if (argc != 2) {
std::cerr << "Usage: " << argv[0] << " <file_path>" << std::endl;
filepath = "/home/wsljan/AIDA/Persistence-Algebra/test_presentations/points_wo_density_20_dim2_k_fold_10_min_pres.scc";
} else {
filepath = argv[1];
}
std::filesystem::path input_path(filepath);
endomorphism_sizes(input_path);
return 0;
} // main