gdiam.cpp File Reference
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <memory.h>
#include <math.h>
#include <vector>
#include <algorithm>
#include "gdiam.h"
+ Include dependency graph for gdiam.cpp:

Go to the source code of this file.

Classes

struct  bbox_2d_info
 
struct  CompareByAngle
 
class  g_heap_pairs_p
 
class  GFSPPair
 
class  GFSPTree
 
class  GFSPTreeNode
 
class  GTreeDiamAlg
 
struct  heap_t
 
class  MinAreaRectangle
 
class  point2d
 
class  ProjPointSet
 
class  vec_point_2d
 

Macros

#define EPS   1e-6
 
#define HEAP_DELTA   10000
 
#define HEAP_LIMIT   10000
 
#define PI   3.14159265958979323846
 
#define UDM_BIG_SAMPLE   2
 
#define UDM_SIMPLE   1
 
#define UMD_SIZE   5
 
#define ZERO_EPS   (1e-6)
 

Typedefs

typedef long double ldouble
 
typedef point2dpoint2d_ptr
 
typedef int(* ptrCompareFunc) (void *aPtr, void *bPtr)
 
typedef void * voidPtr_t
 

Functions

ldouble Area (const point2d &a, const point2d &b, const point2d &c)
 
int AreaSign (const point2d &a, const point2d &b, const point2d &c)
 
gdiam_real bbox_proj_dist (const GBBox &bb1, const GBBox &bb2, gdiam_point_cnt proj)
 
void bbox_vertex (const GBBox &bb, gdiam_point_t &ver, int vert)
 
int compare_pairs (void *_a, void *_b)
 
void computeExtremePair (const gdiam_point *arr, int size, int dim, GPointPair &pp)
 
void construct_base (gdiam_point pnt1, gdiam_point pnt2, gdiam_point pnt3)
 
void convex_hull (vec_point_2d &in, vec_point_2d &out)
 
void dump (vec_point_2d &vec)
 
void dump_points (gdiam_point *in_arr, int size)
 
bool eq_real (gdiam_real a, gdiam_real b)
 
gdiam_bbox gdiam_approx_const_mvbb (gdiam_point *start, int size, gdiam_real eps, GBBox *p_ap_bbox)
 
gdiam_bbox gdiam_approx_const_mvbb (gdiam_real *start, int size, gdiam_real eps)
 
GPointPair gdiam_approx_diam (gdiam_point *start, int size, gdiam_real eps)
 
GPointPair gdiam_approx_diam_pair (gdiam_real *start, int size, gdiam_real eps)
 
GPointPair gdiam_approx_diam_pair_UDM (gdiam_real *start, int size, gdiam_real eps)
 
GPointPair gdiam_approx_diam_UDM (gdiam_point *start, int size, gdiam_real eps)
 
gdiam_bbox gdiam_approx_mvbb (gdiam_point *start, int size, gdiam_real eps)
 
gdiam_bbox gdiam_approx_mvbb_grid (gdiam_point *start, int size, int grid_size)
 
gdiam_bbox gdiam_approx_mvbb_grid_sample (gdiam_point *start, int size, int grid_size, int sample_size)
 
gdiam_bbox gdiam_approx_mvbb_grid_sample (gdiam_real *start, int size, int grid_size, int sample_size)
 
gdiam_pointgdiam_convert (gdiam_real *start, int size)
 
gdiam_pointgdiam_convex_sample (gdiam_point *start, int size, gdiam_bbox &bb, int sample_size)
 
void gdiam_generate_orthonormal_base (gdiam_point in, gdiam_point out1, gdiam_point out2)
 
gdiam_bbox gdiam_mvbb_optimize (gdiam_point *start, int size, gdiam_bbox bb_out, int times)
 
point2d_ptr get_min_point (vec_point_2d &in, int &index)
 
void * heap_delete_max (heap_t *pHeap)
 
void heap_init (heap_t *pHeap, ptrCompareFunc _pCompFunc)
 
void heap_insert (heap_t *pHeap, void *pData)
 
bool heap_is_empty (heap_t *pHeap)
 
void heap_term (heap_t *pHeap)
 
void * heap_top (heap_t *pHeap)
 
bool Left (const point2d &a, const point2d &b, const point2d &c)
 
bool Left_colinear (const point2d &a, const point2d &b, const point2d &c)
 
void verify_convex_hull (vec_point_2d &in, vec_point_2d &ch)
 

Macro Definition Documentation

◆ EPS

#define EPS   1e-6

Definition at line 2021 of file gdiam.cpp.

◆ HEAP_DELTA

#define HEAP_DELTA   10000

Definition at line 40 of file gdiam.cpp.

◆ HEAP_LIMIT

#define HEAP_LIMIT   10000

Definition at line 39 of file gdiam.cpp.

◆ PI

#define PI   3.14159265958979323846

Definition at line 41 of file gdiam.cpp.

◆ UDM_BIG_SAMPLE

#define UDM_BIG_SAMPLE   2

Definition at line 574 of file gdiam.cpp.

◆ UDM_SIMPLE

#define UDM_SIMPLE   1

Definition at line 573 of file gdiam.cpp.

◆ UMD_SIZE

#define UMD_SIZE   5

◆ ZERO_EPS

#define ZERO_EPS   (1e-6)

Definition at line 2369 of file gdiam.cpp.

Typedef Documentation

◆ ldouble

typedef long double ldouble

Definition at line 45 of file gdiam.cpp.

◆ point2d_ptr

typedef point2d* point2d_ptr

Definition at line 1559 of file gdiam.cpp.

◆ ptrCompareFunc

typedef int(* ptrCompareFunc) (void *aPtr, void *bPtr)

Definition at line 640 of file gdiam.cpp.

◆ voidPtr_t

typedef void* voidPtr_t

Definition at line 641 of file gdiam.cpp.

Function Documentation

◆ Area()

ldouble Area ( const point2d a,
const point2d b,
const point2d c 
)
inline

Definition at line 1564 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AreaSign()

int AreaSign ( const point2d a,
const point2d b,
const point2d c 
)
inline

Definition at line 1602 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bbox_proj_dist()

gdiam_real bbox_proj_dist ( const GBBox bb1,
const GBBox bb2,
gdiam_point_cnt  proj 
)

Definition at line 396 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bbox_vertex()

void bbox_vertex ( const GBBox bb,
gdiam_point_t ver,
int  vert 
)

Definition at line 384 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compare_pairs()

int compare_pairs ( void *  _a,
void *  _b 
)

Definition at line 807 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ computeExtremePair()

void computeExtremePair ( const gdiam_point arr,
int  size,
int  dim,
GPointPair pp 
)

Definition at line 876 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ construct_base()

void construct_base ( gdiam_point  pnt1,
gdiam_point  pnt2,
gdiam_point  pnt3 
)

Definition at line 2426 of file gdiam.cpp.

+ Here is the caller graph for this function:

◆ convex_hull()

void convex_hull ( vec_point_2d in,
vec_point_2d out 
)

Definition at line 1882 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dump()

void dump ( vec_point_2d vec)

Definition at line 1717 of file gdiam.cpp.

+ Here is the caller graph for this function:

◆ dump_points()

void dump_points ( gdiam_point in_arr,
int  size 
)

Definition at line 2357 of file gdiam.cpp.

+ Here is the caller graph for this function:

◆ eq_real()

bool eq_real ( gdiam_real  a,
gdiam_real  b 
)
inline

Definition at line 2022 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gdiam_approx_const_mvbb() [1/2]

gdiam_bbox gdiam_approx_const_mvbb ( gdiam_point start,
int  size,
gdiam_real  eps,
GBBox p_ap_bbox 
)

Definition at line 1349 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gdiam_approx_const_mvbb() [2/2]

gdiam_bbox gdiam_approx_const_mvbb ( gdiam_real start,
int  size,
gdiam_real  eps 
)

Definition at line 1447 of file gdiam.cpp.

+ Here is the call graph for this function:

◆ gdiam_approx_diam()

GPointPair gdiam_approx_diam ( gdiam_point start,
int  size,
gdiam_real  eps 
)

Definition at line 1268 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gdiam_approx_diam_pair()

GPointPair gdiam_approx_diam_pair ( gdiam_real start,
int  size,
gdiam_real  eps 
)

Definition at line 1321 of file gdiam.cpp.

+ Here is the call graph for this function:

◆ gdiam_approx_diam_pair_UDM()

GPointPair gdiam_approx_diam_pair_UDM ( gdiam_real start,
int  size,
gdiam_real  eps 
)

Definition at line 1335 of file gdiam.cpp.

+ Here is the call graph for this function:

◆ gdiam_approx_diam_UDM()

GPointPair gdiam_approx_diam_UDM ( gdiam_point start,
int  size,
gdiam_real  eps 
)

Definition at line 1285 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gdiam_approx_mvbb()

gdiam_bbox gdiam_approx_mvbb ( gdiam_point start,
int  size,
gdiam_real  eps 
)

Definition at line 2637 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gdiam_approx_mvbb_grid()

gdiam_bbox gdiam_approx_mvbb_grid ( gdiam_point start,
int  size,
int  grid_size 
)

Definition at line 2742 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gdiam_approx_mvbb_grid_sample() [1/2]

gdiam_bbox gdiam_approx_mvbb_grid_sample ( gdiam_point start,
int  size,
int  grid_size,
int  sample_size 
)

Definition at line 2919 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gdiam_approx_mvbb_grid_sample() [2/2]

gdiam_bbox gdiam_approx_mvbb_grid_sample ( gdiam_real start,
int  size,
int  grid_size,
int  sample_size 
)

Definition at line 2961 of file gdiam.cpp.

+ Here is the call graph for this function:

◆ gdiam_convert()

gdiam_point* gdiam_convert ( gdiam_real start,
int  size 
)

Definition at line 1302 of file gdiam.cpp.

+ Here is the caller graph for this function:

◆ gdiam_convex_sample()

gdiam_point* gdiam_convex_sample ( gdiam_point start,
int  size,
gdiam_bbox bb,
int  sample_size 
)

Definition at line 2851 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gdiam_generate_orthonormal_base()

void gdiam_generate_orthonormal_base ( gdiam_point  in,
gdiam_point  out1,
gdiam_point  out2 
)

Definition at line 1464 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gdiam_mvbb_optimize()

gdiam_bbox gdiam_mvbb_optimize ( gdiam_point start,
int  size,
gdiam_bbox  bb_out,
int  times 
)

Definition at line 2598 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_min_point()

point2d_ptr get_min_point ( vec_point_2d in,
int &  index 
)

Definition at line 1692 of file gdiam.cpp.

+ Here is the caller graph for this function:

◆ heap_delete_max()

void* heap_delete_max ( heap_t pHeap)

Definition at line 736 of file gdiam.cpp.

+ Here is the caller graph for this function:

◆ heap_init()

void heap_init ( heap_t pHeap,
ptrCompareFunc  _pCompFunc 
)

Definition at line 650 of file gdiam.cpp.

+ Here is the caller graph for this function:

◆ heap_insert()

void heap_insert ( heap_t pHeap,
void *  pData 
)

Definition at line 699 of file gdiam.cpp.

+ Here is the caller graph for this function:

◆ heap_is_empty()

bool heap_is_empty ( heap_t pHeap)

Definition at line 799 of file gdiam.cpp.

◆ heap_term()

void heap_term ( heap_t pHeap)

Definition at line 686 of file gdiam.cpp.

+ Here is the caller graph for this function:

◆ heap_top()

void* heap_top ( heap_t pHeap)

Definition at line 730 of file gdiam.cpp.

+ Here is the caller graph for this function:

◆ Left()

bool Left ( const point2d a,
const point2d b,
const point2d c 
)
inline

Definition at line 1617 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Left_colinear()

bool Left_colinear ( const point2d a,
const point2d b,
const point2d c 
)
inline

Definition at line 1624 of file gdiam.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_convex_hull()

void verify_convex_hull ( vec_point_2d in,
vec_point_2d ch 
)

Definition at line 1736 of file gdiam.cpp.

+ Here is the call graph for this function: