![]() |
Parasol Planning Library (PPL)
|
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <string>
#include <algorithm>
#include <containers/sequential/graph/algorithms/connected_components.h>
#include "Vector.h"
#include "IOUtils.h"
#include <boost/math/special_functions/binomial.hpp>
#include <boost/math/special_functions/factorials.hpp>
Go to the source code of this file.
Data Structures | |
struct | CompareSecond< T, U > |
struct | CompareSecondReverse< T, U > |
struct | NullOutputIterator |
MPUtils | |
#define | MAX_INT std::numeric_limits<int>::max() |
#define | MAX_DBL std::numeric_limits<double>::max() |
template<typename T > | |
const T | Epsilon (const T &_t1, const T &_t2) |
double | DRand () |
long | LRand () |
long | MRand () |
double | GRand (bool _reset=false) |
double | GaussianDistribution (double _mean, double _stdev) |
Same as GRand, but one can specify the mean and stdev of the distribution. More... | |
void | SRand (const unsigned long _seed) |
Use seedval as the seed. More... | |
double | Normalize (const double &_a) |
Normalize a value into the range [-1,1). More... | |
double | TriangleHeight (const Point3d &_a, const Point3d &_b, const Point3d &_c) |
bool | PtInTriangle (const Point2d &_a, const Point2d &_b, const Point2d &_c, const Point2d &_p) |
bool | PtInTriangle (const Point2d &_a, const Point2d &_b, const Point2d &_c, const Point2d &_p, double &_u, double &_v) |
Point3d | GetPtFromBarycentricCoords (const Point3d &_a, const Point3d &_b, const Point3d &_c, double _u, double _v) |
double | NormalizeTheta (double _theta) |
template<class CfgType , class Environment > | |
bool | IsWithinResolution (const CfgType &_cfg1, const CfgType &_cfg2, Environment *_env) |
template<class CfgType > | |
CfgType | ClosestPtOnLineSegment (const CfgType &_ref, const CfgType &_p1, const CfgType &_p2) |
bool | binom_test (double _alpha, size_t _n, size_t _k, double _p) |
double | binomial (size_t _n, size_t _k, double _p) |
template<class RandomIterator , class T , class Compare = std::less<T>> | |
RandomIterator | BinarySearch (RandomIterator _begin, RandomIterator _end, const T &_value, Compare _comparator=Compare()) |
std::vector< Cfg > | LoadPath (const std::string &_filename, Robot *_robot) |
Loads a configuration path from a file for a dynamic obstacle. More... | |
template<typename T > | |
T | Identity (const T &_t) noexcept |
#define MAX_DBL std::numeric_limits<double>::max() |
#define MAX_INT std::numeric_limits<int>::max() |
RandomIterator BinarySearch | ( | RandomIterator | _begin, |
RandomIterator | _end, | ||
const T & | _value, | ||
Compare | _comparator = Compare() |
||
) |
Search a random-access container using binary search. Needed for std::vector because std::find cannot know whether the elements are sorted without doing a linear scan.
bool binom_test | ( | double | _alpha, |
size_t | _n, | ||
size_t | _k, | ||
double | _p | ||
) |
Given a significance level, the number of trials, the number of successes and the probability of success. Conduct a two-sided p-test.
_alpha | The reference configuration. |
_n | The number of trials conducted |
_k | The number of trial successes |
_p | The probability of success for the null. The assumed true value of success |
double binomial | ( | size_t | _n, |
size_t | _k, | ||
double | _p | ||
) |
Given the number of trials, the number of successes, and the probability of success, returns the probability density function evaluated k.
_n | The number of trials |
_k | The number of successes we are interested in |
_p | The probability of success |
CfgType ClosestPtOnLineSegment | ( | const CfgType & | _ref, |
const CfgType & | _p1, | ||
const CfgType & | _p2 | ||
) |
Given a reference configuration and a line segment in C-space, find the closest point on the line segment to the reference configuration.
_ref | The reference configuration. |
_p1 | The first endpoint of the line segment. |
_p2 | The second endpoint of the line segment. |
double DRand | ( | ) |
Return non-negative double-prevision floating-point values uniformly distributed over the interval [0.0, 1.0).
const T Epsilon | ( | const T & | _t1, |
const T & | _t2 | ||
) |
Variable resolution epsilon for doubles and float. This number is based upon the resolution of the lower magnitude value between _t1 and _t2.
double GaussianDistribution | ( | double | _mean, |
double | _stdev | ||
) |
Same as GRand, but one can specify the mean and stdev of the distribution.
Point3d GetPtFromBarycentricCoords | ( | const Point3d & | _a, |
const Point3d & | _b, | ||
const Point3d & | _c, | ||
double | _u, | ||
double | _v | ||
) |
Given triange defined by _a, _b, _c, return the point inside triangle defined by barycentric coordinates _u, _v.
double GRand | ( | bool | _reset = false | ) |
Return normally(gaussian) distributed random numbers via the Marsaglia polar method.
_reset | If true, clear internal cache and return 0. |
|
noexcept |
bool IsWithinResolution | ( | const CfgType & | _cfg1, |
const CfgType & | _cfg2, | ||
Environment * | _env | ||
) |
Determine whether two configurations are within a resolution unit of each other.
_cfg1 | The first configuration. |
_cfg2 | The second configuration. |
Loads a configuration path from a file for a dynamic obstacle.
long LRand | ( | ) |
Return non-negative long integers uniformly distributed over the interval [0, 2**31).
long MRand | ( | ) |
Return signed long integers uniformly distributed over the interval [-2**31, 2**31).
double Normalize | ( | const double & | _a | ) |
Normalize a value into the range [-1,1).
double NormalizeTheta | ( | double | _theta | ) |
Normalize an angle to standard range.
_theta | The angle to normalize. |
bool PtInTriangle | ( | const Point2d & | _a, |
const Point2d & | _b, | ||
const Point2d & | _c, | ||
const Point2d & | _p | ||
) |
Check if a 2d point lies inside the triangle defined by three other points.
_a | The first triangle vertex. |
_b | The second triangle vertex. |
_c | The third triangle vertex. |
_p | The query point. |
bool PtInTriangle | ( | const Point2d & | _a, |
const Point2d & | _b, | ||
const Point2d & | _c, | ||
const Point2d & | _p, | ||
double & | _u, | ||
double & | _v | ||
) |
Check if a 2d point lies inside the triangle defined by three other points.
_a | The first triangle vertex. |
_b | The second triangle vertex. |
_c | The third triangle vertex. |
_p | The query point. |
_u | The barycentric coordinate factor for _b. |
_v | The barycentric coordinate factor for _c. |
void SRand | ( | const unsigned long | _seed | ) |
Use seedval as the seed.
double TriangleHeight | ( | const Point3d & | _a, |
const Point3d & | _b, | ||
const Point3d & | _c | ||
) |
Determine height of triangle defined by three points.
_a | The first triangle vertex. |
_b | The second triangle vertex. |
_c | The third triangle vertex. |