Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
general.h File Reference
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <assert.h>
#include <util/exit.h>
#include "cgraph.h"
#include "globals.h"
#include "arith.h"
Include dependency graph for general.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MACHINEACC   1.0e-16
 
#define SQRT_MACHINEACC   1.0e-8
 
#define MINDIST   1.e-15
 

Enumerations

enum  { UNMATCHED = -1 }
 

Functions

int irand (int n)
 
double drand (void)
 
int * random_permutation (int n)
 
double * vector_subtract_to (int n, double *x, double *y)
 
double vector_product (int n, double *x, double *y)
 
double * vector_saxpy (int n, double *x, double *y, double beta)
 
double * vector_saxpy2 (int n, double *x, double *y, double beta)
 
void vector_float_take (int n, float *v, int m, int *p, float **u)
 
void vector_ordering (int n, double *v, int **p)
 
void vector_sort_int (int n, int *v)
 
double distance (double *x, int dim, int i, int j)
 
double distance_cropped (double *x, int dim, int i, int j)
 
double point_distance (double *p1, double *p2, int dim)
 
char * strip_dir (char *s)
 

Macro Definition Documentation

◆ MACHINEACC

#define MACHINEACC   1.0e-16

Definition at line 76 of file general.h.

◆ MINDIST

#define MINDIST   1.e-15

Definition at line 79 of file general.h.

◆ SQRT_MACHINEACC

#define SQRT_MACHINEACC   1.0e-8

Definition at line 77 of file general.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
UNMATCHED 

Definition at line 81 of file general.h.

Function Documentation

◆ distance()

double distance ( double *  x,
int  dim,
int  i,
int  j 
)

Definition at line 145 of file general.c.

References dim, and dist().

Referenced by beautify_leaves(), dist_from_foci(), distance_cropped(), distance_to_group(), furtherest_point(), furtherest_point_in_list(), get_stress(), ideal_distance_matrix(), makeDotGraph(), SparseStressMajorizationSmoother_new(), spring_electrical_embedding(), spring_electrical_embedding_fast(), spring_electrical_embedding_slow(), spring_electrical_spring_embedding(), SpringSmoother_new(), StressMajorizationSmoother2_new(), StressMajorizationSmoother_smooth(), and TriangleSmoother_new().

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

◆ distance_cropped()

double distance_cropped ( double *  x,
int  dim,
int  i,
int  j 
)

Definition at line 140 of file general.c.

◆ drand()

double drand ( void  )
extern

Definition at line 22 of file general.c.

◆ irand()

int irand ( int  n)
extern

Definition at line 26 of file general.c.

Referenced by node_distinct_coloring_internal(), and random_permutation().

Here is the caller graph for this function:

◆ point_distance()

double point_distance ( double *  p1,
double *  p2,
int  dim 
)

Definition at line 153 of file general.c.

◆ random_permutation()

int * random_permutation ( int  n)
extern

Definition at line 33 of file general.c.

References gv_calloc(), irand(), len(), and NULL.

Referenced by maximal_independent_edge_set_heavest_edge_pernode_supernodes_first().

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

◆ strip_dir()

char * strip_dir ( char *  s)

Definition at line 161 of file general.c.

Referenced by makeDotGraph().

Here is the caller graph for this function:

◆ vector_float_take()

void vector_float_take ( int  n,
float *  v,
int  m,
int *  p,
float **  u 
)

Definition at line 78 of file general.c.

References gv_calloc().

Referenced by map_optimal_coloring().

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

◆ vector_ordering()

void vector_ordering ( int  n,
double *  v,
int **  p 
)

Definition at line 115 of file general.c.

References comp_ascend(), free(), and gv_calloc().

Referenced by country_graph_coloring().

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

◆ vector_product()

double vector_product ( int  n,
double *  x,
double *  y 
)

Definition at line 57 of file general.c.

Referenced by conjugate_gradient(), power_method(), and StressMajorizationSmoother_smooth().

Here is the caller graph for this function:

◆ vector_saxpy()

double * vector_saxpy ( int  n,
double *  x,
double *  y,
double  beta 
)

Definition at line 64 of file general.c.

Referenced by conjugate_gradient().

Here is the caller graph for this function:

◆ vector_saxpy2()

double * vector_saxpy2 ( int  n,
double *  x,
double *  y,
double  beta 
)

Definition at line 71 of file general.c.

Referenced by conjugate_gradient().

Here is the caller graph for this function:

◆ vector_sort_int()

void vector_sort_int ( int  n,
int *  v 
)

Definition at line 136 of file general.c.

References comp_ascend_int().

Referenced by ink().

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

◆ vector_subtract_to()

double * vector_subtract_to ( int  n,
double *  x,
double *  y 
)

Definition at line 51 of file general.c.

Referenced by conjugate_gradient().

Here is the caller graph for this function: