Hermes
 All Data Structures Files Functions Variables Macros Pages
Similarity.h File Reference

The implementantion of TRACLUS algorithm. More...

#include "Definition.h"
Include dependency graph for Similarity.h:
This graph shows which files directly or indirectly include this file:

Functions

float8 * EuclideanStart (const Trajectory *trajectoryA, const Trajectory *trajectoryB, float8 *result)
 The function returns the euclidean distance between the first points of the trajectories. More...
 
PGDLLEXPORT Datum EuclideanStartV1 (PG_FUNCTION_ARGS)
 
float8 * EuclideanEnd (const Trajectory *trajectoryA, const Trajectory *trajectoryB, float8 *result)
 The function returns the euclidean distance between the last points of the trajectories. More...
 
PGDLLEXPORT Datum EuclideanEndV1 (PG_FUNCTION_ARGS)
 
float8 * EuclideanStartEnd (const Trajectory *trajectoryA, const Trajectory *trajectoryB, float8 *result)
 The function returns the average euclidean distance between the first and last points of the trajectories. More...
 
PGDLLEXPORT Datum EuclideanStartEndV1 (PG_FUNCTION_ARGS)
 
float8 * Manhattan (const Trajectory *trajectoryA, const Trajectory *trajectoryB, int32 precision, float8 *result)
 The function returns the Manhattan norm between the trajectories. More...
 
PGDLLEXPORT Datum ManhattanV1 (PG_FUNCTION_ARGS)
 
float8 * Euclidean (const Trajectory *trajectoryA, const Trajectory *trajectoryB, int32 precision, float8 *result)
 The function returns the euclidean norm between the trajectories. More...
 
PGDLLEXPORT Datum EuclideanV1 (PG_FUNCTION_ARGS)
 
float8 * Chebyshev (const Trajectory *trajectoryA, const Trajectory *trajectoryB, int32 precision, float8 *result)
 The function returns the maximum norm between the trajectories. More...
 
PGDLLEXPORT Datum ChebyshevV1 (PG_FUNCTION_ARGS)
 
float8 * DISSIM (const Trajectory *trajectoryA, const Trajectory *trajectoryB, int32 precision, float8 *result, float8 *error)
 The function returns DSSIM. More...
 
PGDLLEXPORT Datum DISSIMExact (PG_FUNCTION_ARGS)
 
PGDLLEXPORT Datum DISSIMApproximate (PG_FUNCTION_ARGS)
 
float8 * DTW (const Trajectory *trajectoryA, const Trajectory *trajectoryB, int32 w, float8 w_percentage, int32 lp, float8 *result)
 The function returns the Dynamic Time Warping. More...
 
PGDLLEXPORT Datum DTWV1 (PG_FUNCTION_ARGS)
 
float8 * LCSS (const Trajectory *trajectoryA, const Trajectory *trajectoryB, int32 w, float8 w_percentage, float8 eps, float8 *result)
 The function returns the Longest Common Subsequence. More...
 
PGDLLEXPORT Datum LCSSV1 (PG_FUNCTION_ARGS)
 
float8 * EDR (const Trajectory *trajectoryA, const Trajectory *trajectoryB, float8 eps, float8 *result)
 The function returns the EDR. More...
 
PGDLLEXPORT Datum EDRV1 (PG_FUNCTION_ARGS)
 
float8 * ERP (const Trajectory *trajectoryA, const Trajectory *trajectoryB, int32 lp, float8 *result)
 The function returns the ERP. More...
 
PGDLLEXPORT Datum ERPV1 (PG_FUNCTION_ARGS)
 

Detailed Description

The implementantion of TRACLUS algorithm.

Author
Giannis Kostis (jkost.nosp@m.is@g.nosp@m.mail..nosp@m.com)

Similarity functions between trajectories. For more detailed descritpion look at Distance functions

See also
Distance functions
Trajectory/Similarity.sql

Function Documentation

float8* Chebyshev ( const Trajectory trajectoryA,
const Trajectory trajectoryB,
int32  precision,
float8 *  result 
)

The function returns the maximum norm between the trajectories.

Parameters
[in]trajectoryAThe first trajectory
[in]trajectoryBThe second trajectory
[in]precisionThe wanted precision
[out]resultThe result

References atInstantTrajectory(), distanceChebyshevPointSP_PointSP(), Trajectory::NrPoints, Trajectory::points, PointST::sp, and PointST::t.

Referenced by ChebyshevV1().

Here is the call graph for this function:

PGDLLEXPORT Datum ChebyshevV1 ( PG_FUNCTION_ARGS  )

References Chebyshev(), and validateInterpolationPrecision().

Here is the call graph for this function:

float8* DISSIM ( const Trajectory trajectoryA,
const Trajectory trajectoryB,
int32  precision,
float8 *  result,
float8 *  error 
)

The function returns DSSIM.

Parameters
[in]trajectoryAThe first trajectory
[in]trajectoryBThe second trajectory
[in]precisionThe wanted precision
[out]resultThe result
[out]errorThe error

References atInstantTrajectory(), compute_segment_dissim(), Trajectory::NrPoints, Trajectory::points, and PointST::t.

Referenced by DISSIMApproximate(), and DISSIMExact().

Here is the call graph for this function:

PGDLLEXPORT Datum DISSIMApproximate ( PG_FUNCTION_ARGS  )

References DISSIM(), and validateInterpolationPrecision().

Here is the call graph for this function:

PGDLLEXPORT Datum DISSIMExact ( PG_FUNCTION_ARGS  )

References DISSIM(), and validateInterpolationPrecision().

Here is the call graph for this function:

float8* DTW ( const Trajectory trajectoryA,
const Trajectory trajectoryB,
int32  w,
float8  w_percentage,
int32  lp,
float8 *  result 
)

The function returns the Dynamic Time Warping.

Parameters
[in]trajectoryAThe first trajectory
[in]trajectoryBThe second trajectory
[in]wthe locality constraint
[in]w_percentageif w < 0 then someone can use percentage of the the trajectory by defining this value
[in]lpthe norm to be used (currently only 1 and 2)
[out]resultThe result

References distanceManhattanPointSP_PointSP(), i(), j, min(), Trajectory::NrPoints, Trajectory::points, PointST::sp, and sqDistancePointSP_PointSP().

Referenced by DTWV1().

Here is the call graph for this function:

PGDLLEXPORT Datum DTWV1 ( PG_FUNCTION_ARGS  )

References DTW().

Here is the call graph for this function:

float8* EDR ( const Trajectory trajectoryA,
const Trajectory trajectoryB,
float8  eps,
float8 *  result 
)

The function returns the EDR.

Parameters
[in]trajectoryAThe first trajectory
[in]trajectoryBThe second trajectory
[in]epsthe threshold, which determines whether or not two elements match.
[out]resultThe result

References GAP, HIT, i(), j, MISS, Trajectory::NrPoints, Trajectory::points, PointST::sp, PointSP::x, and PointSP::y.

Referenced by EDRV1().

Here is the call graph for this function:

PGDLLEXPORT Datum EDRV1 ( PG_FUNCTION_ARGS  )

References EDR().

Here is the call graph for this function:

float8* ERP ( const Trajectory trajectoryA,
const Trajectory trajectoryB,
int32  lp,
float8 *  result 
)

The function returns the ERP.

Parameters
[in]trajectoryAThe first trajectory
[in]trajectoryBThe second trajectory
[in]lpthe norm to be used (currently only 1 and 2)
[out]resultThe result

References distanceManhattanPointSP_PointSP(), distancePointSP_PointSP(), i(), j, Trajectory::NrPoints, Trajectory::points, PointST::sp, PointSP::x, and PointSP::y.

Referenced by ERPV1().

Here is the call graph for this function:

PGDLLEXPORT Datum ERPV1 ( PG_FUNCTION_ARGS  )

References ERP().

Here is the call graph for this function:

float8* Euclidean ( const Trajectory trajectoryA,
const Trajectory trajectoryB,
int32  precision,
float8 *  result 
)

The function returns the euclidean norm between the trajectories.

Parameters
[in]trajectoryAThe first trajectory
[in]trajectoryBThe second trajectory
[in]precisionThe wanted precision
[out]resultThe result

References atInstantTrajectory(), Trajectory::NrPoints, Trajectory::points, PointST::sp, sqDistancePointSP_PointSP(), and PointST::t.

Referenced by EuclideanV1().

Here is the call graph for this function:

float8* EuclideanEnd ( const Trajectory trajectoryA,
const Trajectory trajectoryB,
float8 *  result 
)

The function returns the euclidean distance between the last points of the trajectories.

Parameters
[in]trajectoryAThe first trajectory
[in]trajectoryBThe second trajectory
[out]resultThe result

References distancePointSP_PointSP(), Trajectory::NrPoints, Trajectory::points, and PointST::sp.

Referenced by EuclideanEndV1().

Here is the call graph for this function:

PGDLLEXPORT Datum EuclideanEndV1 ( PG_FUNCTION_ARGS  )

References EuclideanEnd().

Here is the call graph for this function:

float8* EuclideanStart ( const Trajectory trajectoryA,
const Trajectory trajectoryB,
float8 *  result 
)

The function returns the euclidean distance between the first points of the trajectories.

Parameters
[in]trajectoryAThe first trajectory
[in]trajectoryBThe second trajectory
[out]resultThe result

References distancePointSP_PointSP(), Trajectory::NrPoints, Trajectory::points, and PointST::sp.

Referenced by EuclideanStartV1().

Here is the call graph for this function:

float8* EuclideanStartEnd ( const Trajectory trajectoryA,
const Trajectory trajectoryB,
float8 *  result 
)

The function returns the average euclidean distance between the first and last points of the trajectories.

Parameters
[in]trajectoryAThe first trajectory
[in]trajectoryBThe second trajectory
[out]resultThe result

References distancePointSP_PointSP(), Trajectory::NrPoints, Trajectory::points, and PointST::sp.

Referenced by EuclideanStartEndV1().

Here is the call graph for this function:

PGDLLEXPORT Datum EuclideanStartEndV1 ( PG_FUNCTION_ARGS  )

References EuclideanStartEnd().

Here is the call graph for this function:

PGDLLEXPORT Datum EuclideanStartV1 ( PG_FUNCTION_ARGS  )

References EuclideanStart().

Here is the call graph for this function:

PGDLLEXPORT Datum EuclideanV1 ( PG_FUNCTION_ARGS  )

References Euclidean(), and validateInterpolationPrecision().

Here is the call graph for this function:

float8* LCSS ( const Trajectory trajectoryA,
const Trajectory trajectoryB,
int32  w,
float8  w_percentage,
float8  eps,
float8 *  result 
)

The function returns the Longest Common Subsequence.

Parameters
[in]trajectoryAThe first trajectory
[in]trajectoryBThe second trajectory
[in]wthe locality constraint
[in]w_percentageif w < 0 then someone can use percentage of the the trajectory by defining this value
[in]epsthe threshold, which determines whether or not two elements match. if eps<=0 or eps>=1 then eps = min(stedev(trajectories))
[out]resultThe result

References i(), j, match(), Trajectory::NrPoints, Trajectory::points, PointST::sp, and stddevTrajectory().

Referenced by LCSSV1().

Here is the call graph for this function:

PGDLLEXPORT Datum LCSSV1 ( PG_FUNCTION_ARGS  )

References LCSS().

Here is the call graph for this function:

float8* Manhattan ( const Trajectory trajectoryA,
const Trajectory trajectoryB,
int32  precision,
float8 *  result 
)

The function returns the Manhattan norm between the trajectories.

Parameters
[in]trajectoryAThe first trajectory
[in]trajectoryBThe second trajectory
[in]precisionThe wanted precision
[out]resultThe result

References atInstantTrajectory(), distanceManhattanPointSP_PointSP(), Trajectory::NrPoints, Trajectory::points, PointST::sp, and PointST::t.

Referenced by ManhattanV1().

Here is the call graph for this function:

PGDLLEXPORT Datum ManhattanV1 ( PG_FUNCTION_ARGS  )

References Manhattan(), and validateInterpolationPrecision().

Here is the call graph for this function: