Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
trap.h File Reference

trapezoid elements and utilities for partition.c More...

#include <stdbool.h>
#include <stddef.h>
Include dependency graph for trap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  segment_t
 
struct  trap_t
 
struct  traps_t
 an array of trapezoids More...
 

Macros

#define ST_VALID   1 /* for trapezium state */
 
#define ST_INVALID   2
 
#define C_EPS   1.0e-7 /* tolerance value: Used for making */
 
#define FP_EQUAL(s, t)   (fabs(s - t) <= C_EPS)
 
#define _equal_to(v0, v1)    (FP_EQUAL((v0)->y, (v1)->y) && FP_EQUAL((v0)->x, (v1)->x))
 
#define _greater_than(v0, v1)    (((v0)->y > (v1)->y + C_EPS) ? true : (((v0)->y < (v1)->y - C_EPS) ? false : ((v0)->x > (v1)->x)))
 

Functions

static int dfp_cmp (double f1, double f2)
 double floating point three-way comparison
 
traps_t construct_trapezoids (int, segment_t *, int *)
 

Detailed Description

Macro Definition Documentation

◆ _equal_to

#define _equal_to (   v0,
  v1 
)     (FP_EQUAL((v0)->y, (v1)->y) && FP_EQUAL((v0)->x, (v1)->x))

Definition at line 80 of file trap.h.

◆ _greater_than

#define _greater_than (   v0,
  v1 
)     (((v0)->y > (v1)->y + C_EPS) ? true : (((v0)->y < (v1)->y - C_EPS) ? false : ((v0)->x > (v1)->x)))

Definition at line 83 of file trap.h.

◆ C_EPS

#define C_EPS   1.0e-7 /* tolerance value: Used for making */

Definition at line 56 of file trap.h.

◆ FP_EQUAL

#define FP_EQUAL (   s,
 
)    (fabs(s - t) <= C_EPS)

Definition at line 61 of file trap.h.

◆ ST_INVALID

#define ST_INVALID   2

Definition at line 54 of file trap.h.

◆ ST_VALID

#define ST_VALID   1 /* for trapezium state */

Definition at line 53 of file trap.h.

Function Documentation

◆ construct_trapezoids()

traps_t construct_trapezoids ( int  nseg,
segment_t seg,
int *  permute 
)
extern

Definition at line 924 of file trapezoid.c.

References add_segment(), qnodes_t::data, find_new_roots(), free(), gv_calloc(), init_query_structure(), traps_t::length, qnodes_t::length, math_logstar_n(), and math_N().

Referenced by partition().

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

◆ dfp_cmp()

static int dfp_cmp ( double  f1,
double  f2 
)
inlinestatic

Returns -1, 0, or 1 if f1 respectively, less than, almost equal with tolerance C_EPS, or greater than f2. The purpose of the function is workaround precision issues.

Definition at line 71 of file trap.h.

References C_EPS.

Referenced by hcmpid(), and vcmpid().

Here is the caller graph for this function: