Creepy-simulation
 
Loading...
Searching...
No Matches
utils.cpp File Reference
#include "utils.hpp"
#include <cmath>
#include <stdexcept>

Classes

struct  DistanceFunc::PolarPoint
 

Namespaces

namespace  DistanceFunc
 Namespace containing distance calculation functions and types.
 

Functions

std::mt19937 & getRandom ()
 Retrieves a shared random number generator.
 
double DistanceFunc::euclideanSquared (const Point &p1, const Point &p2)
 Computes the squared Euclidean distance between two points.
 
double DistanceFunc::manhattanSquared (const Point &p1, const Point &p2)
 Computes the squared Manhattan distance between two points.
 
double DistanceFunc::polarSquared (const Point &p1, const Point &p2)
 Computes the squared polar distance between two points.
 
std::function< double(Point p1, Point p2)> DistanceFunc::funcToType (Type funcType)
 Maps a distance function type to its corresponding function.
 

Function Documentation

◆ getRandom()

std::mt19937 & getRandom ( )

Retrieves a shared random number generator.

Returns
A reference to the random number generator.