TTK
|
Go to the source code of this file.
Namespaces | |
namespace | ttk |
The Topology ToolKit. | |
namespace | ttk::Geometry |
Macros | |
#define | TTK_POW_LAMBDA(CALLEXPR, TYPE, EXPN, ...) |
Optimized Power function with lambdas. | |
Functions | |
template<typename T > | |
T | ttk::Geometry::angle (const T *vA0, const T *vA1, const T *vB0, const T *vB1) |
template<typename T > | |
T | ttk::Geometry::angle2D (const T *vA0, const T *vA1, const T *vB0, const T *vB1) |
template<typename T > | |
double | ttk::Geometry::angle2DUndirected (const T *vA, const T *vB, const T *vC) |
template<typename T > | |
bool | ttk::Geometry::areVectorsColinear (const T *vA0, const T *vA1, const T *vB0, const T *vB1, std::array< T, 3 > *coefficients=nullptr, const T *tolerance=NULL) |
template<typename T > | |
bool | ttk::Geometry::isTriangleColinear2D (const T *pptA, const T *pptB, const T *pptC, const T tolerance) |
template<typename T > | |
int | ttk::Geometry::computeBarycentricCoordinates (const T *p0, const T *p1, const T *p, std::array< T, 2 > &baryCentrics, const int &dimension=3) |
template<typename T > | |
int | ttk::Geometry::computeBarycentricCoordinates (const T *p0, const T *p1, const T *p2, const T *p, std::array< T, 3 > &baryCentrics) |
template<typename T > | |
bool | ttk::Geometry::computeSegmentIntersection (const T &xA, const T &yA, const T &xB, const T &yB, const T &xC, const T &yC, const T &xD, const T &yD, T &x, T &y) |
template<typename T > | |
int | ttk::Geometry::computeTriangleAngles (const T *p0, const T *p1, const T *p2, std::array< T, 3 > &angles) |
template<typename T > | |
int | ttk::Geometry::computeTriangleAngleFromSides (const T s0, const T s1, const T s2, T &angle) |
template<typename T > | |
int | ttk::Geometry::computeTriangleArea (const T *p0, const T *p1, const T *p2, T &area) |
template<typename T > | |
int | ttk::Geometry::computeTriangleAreaFromSides (const T s0, const T s1, const T s2, T &area) |
template<typename T > | |
int | ttk::Geometry::crossProduct (const T *vA0, const T *vA1, const T *vB0, const T *vB1, std::array< T, 3 > &crossProduct) |
template<typename T > | |
int | ttk::Geometry::crossProduct (const T *vA, const T *vB, T *crossProduct) |
template<typename T > | |
T | ttk::Geometry::distance (const T *p0, const T *p1, const int &dimension=3) |
template<typename T > | |
T | ttk::Geometry::distance (const std::vector< T > &p0, const std::vector< T > &p1) |
template<typename T > | |
T | ttk::Geometry::distance2D (const T *p0, const T *p1) |
template<typename T > | |
T | ttk::Geometry::distanceFlatten (const std::vector< std::vector< T > > &p0, const std::vector< std::vector< T > > &p1) |
template<typename T > | |
T | ttk::Geometry::dotProduct (const T *vA0, const T *vA1, const T *vB0, const T *vB1) |
template<typename T > | |
T | ttk::Geometry::dotProduct (const T *vA, const T *vB, const int &dimension=3) |
template<typename T > | |
T | ttk::Geometry::dotProduct (const std::vector< T > &vA, const std::vector< T > &vB) |
template<typename T > | |
T | ttk::Geometry::dotProductFlatten (const std::vector< std::vector< T > > &vA, const std::vector< std::vector< T > > &vB) |
template<typename T , typename Container , size_t dim> | |
int | ttk::Geometry::getBoundingBox (const Container &points, std::array< std::pair< T, T >, dim > &bBox) |
template<typename T > | |
bool | ttk::Geometry::isPointInTriangle (const T *p0, const T *p1, const T *p2, const T *p) |
template<typename T > | |
bool | ttk::Geometry::isPointOnSegment (const T &x, const T &y, const T &xA, const T &yA, const T &xB, const T &yB) |
template<typename T > | |
bool | ttk::Geometry::isPointOnSegment (const T *p, const T *pA, const T *pB, const int &dimension=3) |
template<typename T > | |
bool | ttk::Geometry::isTriangleColinear (const T *p0, const T *p1, const T *p2, const T *tolerance=nullptr) |
template<typename T > | |
T | ttk::Geometry::magnitude (const T *v, const int &dimension=3) |
template<typename T > | |
T | ttk::Geometry::magnitude (const std::vector< T > &v) |
template<typename T > | |
T | ttk::Geometry::magnitudeFlatten (const std::vector< std::vector< T > > &v) |
template<typename T > | |
T | ttk::Geometry::magnitude (const T *o, const T *d) |
template<typename T > | |
T | ttk::Geometry::powInt (const T val, const int n) |
template<typename T = double> | |
T | ttk::Geometry::powIntTen (const int n) |
Compute the nth power of ten. | |
template<typename T1 , typename T2 > | |
T1 | ttk::Geometry::pow (const T1 val, const T2 n) |
template<typename T > | |
int | ttk::Geometry::subtractVectors (const T *a, const T *b, T *out, const int &dimension=3) |
template<typename T > | |
int | ttk::Geometry::subtractVectors (const std::vector< T > &a, const std::vector< T > &b, std::vector< T > &out) |
template<typename T > | |
int | ttk::Geometry::addVectors (const T *a, const T *b, T *out, const int &dimension=3) |
template<typename T > | |
int | ttk::Geometry::addVectors (const std::vector< T > &a, const std::vector< T > &b, std::vector< T > &out) |
template<typename T > | |
int | ttk::Geometry::multiAddVectors (const std::vector< std::vector< T > > &a, const std::vector< std::vector< T > > &b, std::vector< std::vector< T > > &out) |
template<typename T > | |
int | ttk::Geometry::multiAddVectorsFlatten (const std::vector< std::vector< std::vector< T > > > &a, const std::vector< std::vector< std::vector< T > > > &b, std::vector< std::vector< T > > &out) |
template<typename T > | |
int | ttk::Geometry::scaleVector (const T *a, const T factor, T *out, const int &dimension=3) |
template<typename T > | |
int | ttk::Geometry::scaleVector (const std::vector< T > &a, const T factor, std::vector< T > &out) |
template<typename T > | |
int | ttk::Geometry::vectorProjection (const T *a, const T *b, T *out, const int &dimension=3) |
template<typename T > | |
int | ttk::Geometry::vectorProjection (const std::vector< T > &a, const std::vector< T > &b, std::vector< T > &out) |
template<typename T > | |
void | ttk::Geometry::addVectorsProjection (const std::vector< T > &a, const std::vector< T > &b, std::vector< T > &a_out, std::vector< T > &b_out) |
template<typename T > | |
void | ttk::Geometry::gramSchmidt (const std::vector< std::vector< T > > &a, std::vector< std::vector< T > > &out) |
template<typename T > | |
bool | ttk::Geometry::isVectorUniform (const std::vector< T > &a) |
template<typename T > | |
bool | ttk::Geometry::isVectorNull (const std::vector< T > &a) |
template<typename T > | |
bool | ttk::Geometry::isVectorNullFlatten (const std::vector< std::vector< T > > &a) |
template<typename T > | |
int | ttk::Geometry::flattenMultiDimensionalVector (const std::vector< std::vector< T > > &a, std::vector< T > &out) |
template<typename T > | |
int | ttk::Geometry::multiFlattenMultiDimensionalVector (const std::vector< std::vector< std::vector< T > > > &a, std::vector< std::vector< T > > &out) |
template<typename T > | |
int | ttk::Geometry::unflattenMultiDimensionalVector (const std::vector< T > &a, std::vector< std::vector< T > > &out, const int &no_columns=2) |
template<typename T > | |
void | ttk::Geometry::matrixMultiplication (const std::vector< std::vector< T > > &a, const std::vector< std::vector< T > > &b, std::vector< std::vector< T > > &out) |
template<typename T > | |
void | ttk::Geometry::subtractMatrices (const std::vector< std::vector< T > > &a, const std::vector< std::vector< T > > &b, std::vector< std::vector< T > > &out) |
template<typename T > | |
void | ttk::Geometry::addMatrices (const std::vector< std::vector< T > > &a, const std::vector< std::vector< T > > &b, std::vector< std::vector< T > > &out) |
template<typename T > | |
void | ttk::Geometry::scaleMatrix (const std::vector< std::vector< T > > &a, const T factor, std::vector< std::vector< T > > &out) |
template<typename T > | |
void | ttk::Geometry::transposeMatrix (const std::vector< std::vector< T > > &a, std::vector< std::vector< T > > &out) |
#define TTK_POW_LAMBDA | ( | CALLEXPR, | |
TYPE, | |||
EXPN, | |||
... | |||
) |
Optimized Power function with lambdas.
If ttk::Geometry::powInt, the integer power function, is called in a hot path, the if statements on the integer exponent can limit the performance. This macro helps by extracting the specialized computations for a given integer exponent into lambdas. These lambdas can be passed as arguments to a templated function outside the hot path to bypass the if statements.
[in] | CALLEXPR | Expression containing the call to a templated function/method. This templated function should take one of the lambdas as last parameter. |
[in] | TYPE | Data type (template parameter). |
[in] | EXPN | Local variable containing the integer exponent. |
[in] | ... | List of CALLEXPR arguments before the lambda placeholder. |
c.f. ttk::LDistance or ttk::KDTree for example uses.
Definition at line 428 of file Geometry.h.