A C++ shared library for computing isotopy types of patchworks.
Warning: While the core algorithm is tested, usage of this library in other projects is not. Use with caution and report any issues you encounter.
For detailed API documentation, use the man page:
man docs/man/man3/Isotopy_Graph.3- Provides the
Isotopy::Graphclass for representing isotopy types of patchworks. - Methods to compute isotopy types and generate Viro notation.
Examples can be found as test cases in the file tests/isotopy_graph.cpp.
This project uses a Makefile for building the shared library and running tests.
To build the shared library:
makeTo run the tests:
make testTo clean build artifacts:
make clean-
Include the header in your project:
#include "isotopy_graph.h"
-
Link against the shared library:
g++ myfile.cpp -L/path/to/lib -lisotopy
-
Example code:
#include "isotopy_graph.h"
int main() {
int delta = 2;
std::vector<bool> sign = {true, true, true, true, true, true};
std::vector<std::pair<int, int>> edges = {{0, 1}, {1, 2}, {0, 3}, {3, 4}, {2, 4}, {1,3}, {1,4}, {4,5}, {3,5}};
Isotopy::Graph g(delta, sign, edges);
g.isotopy_type();
std::string notation = g.viro_notation();
int even = g.even_regions();
int odd = g.odd_regions();
bool mcurve = g.is_mcurve();
}