coordinates_generator
functions.hpp File Reference
#include <cmath>
#include <memory>
#include <iterator>
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <fstream>
#include <string>
#include "triangulation.hpp"
#include <queue>
#include <unordered_set>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/geometries/adapted/boost_tuple.hpp>
#include <boost/geometry/algorithms/assign.hpp>

Go to the source code of this file.

Classes

struct  Vertex
 Class to store vertex, containing information about edge to_ going into it More...
 
struct  Face
 Structure to store a face containing about one edge incident to it More...
 
struct  Edge
 Structure to store the edge containing information about next_, prev_, opposite_ edges and vertices and face incident to it. More...
 
struct  graph
 Main class to store all the information about graph, edges, vertices, ... More...
 
struct  fingerprints
 Structure for generating all fingerprints iteratively. More...
 

Macros

#define M_PI   3.14159265358979323846
 
#define INF   100000000
 
#define EPSILON   0.0001
 
#define x   first
 
#define y   second
 

Typedefs

using array_4D = vector< vector< vector< vector< bool > > > >
 

Functions

bool if_two_segmetns_intersects (pair< shared_ptr< Vertex >, shared_ptr< Vertex > > line1, pair< shared_ptr< Vertex >, shared_ptr< Vertex > > line2)
 Function to detect whether line1 and line2 intersect. More...
 
void create_coordinates (const vector< shared_ptr< Vertex > > &points, vector< vector< double > > &distances)
 Function to set distance Euclidian distance for all pair of points i, j in points into matrix distances. More...
 
void dijsktra (vector< shared_ptr< Vertex > > &points, vector< vector< double > > distances, vector< int > &parent)
 Standart dijsktra algorithm returning shortest paths from vertex 0 with paths stored in vector parent. More...
 
void print_graph (graph *g)
 
vector< pair< double, double > > create_circle (double radius, double cx, double cy, int n)
 Function to create "dummy" vertices for one vertex. More...
 
double distance (pair< double, double > a)
 
double distance (pair< double, double > a, pair< double, double > b)
 
double distance (shared_ptr< Vertex > a, shared_ptr< Vertex > b)
 
vector< pair< double, double > > make_convex_hull (vector< pair< double, double > > vertices)
 Function to create convex hull of vertices. More...
 
bool compare (pair< double, double > a, pair< double, double > b)
 Check whether the two pairs are "almost" the same. More...
 
double det (pair< double, double > vec1, pair< double, double > vec2)
 Fucntion to count the determinant. More...
 
pair< double, double > get_shift (shared_ptr< Vertex > vertex, pair< double, double > vect)
 Function to generate shift perpendicular to given vector vect in order to be able to move same vertices to distinguish them. More...
 
pair< double, double > find_vertex_in_right_direction (shared_ptr< Vertex > vertex, pair< double, double > vect)
 Get vertex perpendicular to vect from vertex and on the right side depending on the clockwise, counterclockwise order of vertices. More...
 
double get_value (int a, int b, int c, shared_ptr< Vertex > point)
 Get value of linear function f(x, y) = ax+by+c. More...
 
bool is_on_right_side_of (shared_ptr< Vertex >asked_point, shared_ptr< Vertex > point, pair< double, double > vect, shared_ptr< Vertex > on_right_side)
 Function to check whether asked_point and on_right_side points are on the same side of line given by point and vector vect. More...
 
bool are_collinear (shared_ptr< Vertex > v1, shared_ptr< Vertex > v2, shared_ptr< Vertex > v3)
 
long long factorial (int n)
 
bool are_there_ends (Edge *edge, int a, int b)
 Function to check whether the ends of edge are a and b. More...
 

Variables

bool print_bool = false
 

Macro Definition Documentation

◆ EPSILON

#define EPSILON   0.0001

◆ INF

#define INF   100000000

◆ M_PI

#define M_PI   3.14159265358979323846

◆ x

#define x   first

◆ y

#define y   second

Typedef Documentation

◆ array_4D

using array_4D = vector<vector<vector<vector<bool> > > >

Function Documentation

◆ are_collinear()

bool are_collinear ( shared_ptr< Vertex v1,
shared_ptr< Vertex v2,
shared_ptr< Vertex v3 
)
inline

◆ are_there_ends()

bool are_there_ends ( Edge edge,
int  a,
int  b 
)
inline

Function to check whether the ends of edge are a and b.

Parameters
edge
a
b
Returns

◆ compare()

bool compare ( pair< double, double >  a,
pair< double, double >  b 
)
inline

Check whether the two pairs are "almost" the same.

Parameters
a
b
Returns

◆ create_circle()

vector<pair<double, double> > create_circle ( double  radius,
double  cx,
double  cy,
int  n 
)
inline

Function to create "dummy" vertices for one vertex.

Parameters
radius
cx
cy
n
Returns

◆ create_coordinates()

void create_coordinates ( const vector< shared_ptr< Vertex > > &  points,
vector< vector< double > > &  distances 
)
inline

Function to set distance Euclidian distance for all pair of points i, j in points into matrix distances.

Parameters
points
distances

◆ det()

double det ( pair< double, double >  vec1,
pair< double, double >  vec2 
)
inline

Fucntion to count the determinant.

Parameters
vec1
vec2
Returns

◆ dijsktra()

void dijsktra ( vector< shared_ptr< Vertex > > &  points,
vector< vector< double > >  distances,
vector< int > &  parent 
)
inline

Standart dijsktra algorithm returning shortest paths from vertex 0 with paths stored in vector parent.

Parameters
points
distances
parent

◆ distance() [1/3]

double distance ( pair< double, double >  a)
inline

◆ distance() [2/3]

double distance ( pair< double, double >  a,
pair< double, double >  b 
)
inline

◆ distance() [3/3]

double distance ( shared_ptr< Vertex a,
shared_ptr< Vertex b 
)
inline

◆ factorial()

long long factorial ( int  n)
inline

◆ find_vertex_in_right_direction()

pair<double, double> find_vertex_in_right_direction ( shared_ptr< Vertex vertex,
pair< double, double >  vect 
)
inline

Get vertex perpendicular to vect from vertex and on the right side depending on the clockwise, counterclockwise order of vertices.

Parameters
vertex
vect
Returns

◆ get_shift()

pair<double, double> get_shift ( shared_ptr< Vertex vertex,
pair< double, double >  vect 
)
inline

Function to generate shift perpendicular to given vector vect in order to be able to move same vertices to distinguish them.

Parameters
vertex
vect
Returns

◆ get_value()

double get_value ( int  a,
int  b,
int  c,
shared_ptr< Vertex point 
)
inline

Get value of linear function f(x, y) = ax+by+c.

Parameters
a
b
c
point
Returns

◆ if_two_segmetns_intersects()

bool if_two_segmetns_intersects ( pair< shared_ptr< Vertex >, shared_ptr< Vertex > >  line1,
pair< shared_ptr< Vertex >, shared_ptr< Vertex > >  line2 
)
inline

Function to detect whether line1 and line2 intersect.

Parameters
line1
line2
Returns

◆ is_on_right_side_of()

bool is_on_right_side_of ( shared_ptr< Vertex asked_point,
shared_ptr< Vertex point,
pair< double, double >  vect,
shared_ptr< Vertex on_right_side 
)
inline

Function to check whether asked_point and on_right_side points are on the same side of line given by point and vector vect.

Parameters
asked_point
point
vect
on_right_side
Returns

◆ make_convex_hull()

vector<pair<double, double> > make_convex_hull ( vector< pair< double, double > >  vertices)
inline

Function to create convex hull of vertices.

Parameters
vertices
Returns

◆ print_graph()

void print_graph ( graph g)
inline

Variable Documentation

◆ print_bool

bool print_bool = false
inline