#include <gudhi/graph_simplicial_complex.h>
#include <gudhi/Simplex_tree.h>
#include <gudhi/Persistent_cohomology.h>
#include <iostream>
#include <ctime>
#include <utility>
#include <vector>
using typeVectorVertex = std::vector< Simplex_tree::Vertex_handle >;
void usage(char * const progName) {
std::cerr << "Usage: " << progName << " coeff_field_characteristic[integer > 0] min_persistence[float >= -1.0]\n";
exit(-1);
}
int main(int argc, char * const argv[]) {
if (argc != 3) {
std::cerr << "Error: Number of arguments (" << argc << ") is not correct\n";
usage(argv[0]);
}
int coeff_field_characteristic = 0;
int returnedScanValue = sscanf(argv[1], "%d", &coeff_field_characteristic);
if ((returnedScanValue == EOF) || (coeff_field_characteristic <= 0)) {
std::cerr << "Error: " << argv[1] << " is not correct\n";
usage(argv[0]);
}
returnedScanValue = sscanf(argv[2], "%lf", &min_persistence);
if ((returnedScanValue == EOF) || (min_persistence < -1.0)) {
std::cerr << "Error: " << argv[2] << " is not correct\n";
usage(argv[0]);
}
std::cout << "********************************************************************" << std::endl;
std::cout << "TEST OF INSERTION" << std::endl;
std::cout << " - INSERT (0,1,2)" << std::endl;
typeVectorVertex SimplexVector = {0, 1, 2};
std::cout << " - INSERT 3" << std::endl;
SimplexVector = {3};
std::cout << " - INSERT (0,3)" << std::endl;
SimplexVector = {0, 3};
std::cout << " - INSERT (0,1) (already inserted)" << std::endl;
SimplexVector = {0, 1};
std::cout << " - INSERT (3,4,5)" << std::endl;
SimplexVector = {3, 4, 5};
std::cout << " - INSERT (0,1,6,7)" << std::endl;
SimplexVector = {0, 1, 6, 7};
std::cout << " - INSERT (4,5,8,9)" << std::endl;
SimplexVector = {4, 5, 8, 9};
std::cout << " - INSERT (9,10,11)" << std::endl;
SimplexVector = {9, 10, 11};
std::cout << " - INSERT (2,10,12)" << std::endl;
SimplexVector = {2, 10, 12};
std::cout << " - INSERT (11,6)" << std::endl;
SimplexVector = {6, 11};
std::cout << " - INSERT (13,14,15)" << std::endl;
SimplexVector = {13, 14, 15};
<< std::endl;
std::cout <<
" - dimension " << st.
dimension() << std::endl;
std::cout << std::endl << std::endl << "Iterator on Simplices in the filtration, with [filtration value]:"
<< std::endl;
std::cout << "**************************************************************" << std::endl;
std::cout << "strict graph G { " << std::endl;
std::cout <<
" " <<
"[" << st.
filtration(f_simplex) <<
"] ";
std::cout << static_cast<int>(vertex) << " -- ";
}
std::cout << ";" << std::endl;
}
std::cout << "}" << std::endl;
std::cout << "**************************************************************" << std::endl;
return 0;
}