Graphviz  2.41.20171026.1811
Macros | Enumerations | Functions
general.h File Reference
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <assert.h>
#include <cgraph.h>
#include <globals.h>
#include <logic.h>
#include <arith.h>
#include <memory.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 real   double
 
#define set_flag(a, flag)   ((a)=((a)|(flag)))
 
#define test_flag(a, flag)   ((a)&(flag))
 
#define clear_flag(a, flag)   ((a) &=(~(flag)))
 
#define MALLOC   gmalloc
 
#define REALLOC   grealloc
 
#define FREE   free
 
#define MEMCPY   memcpy
 
#define NDEBUG   /* switch off assert*/
 
#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)
 
real drand (void)
 
intrandom_permutation (int n)
 
realvector_subtract_to (int n, real *x, real *y)
 
realvector_subtract_from (int n, real *x, real *y)
 
realvector_add_to (int n, real *x, real *y)
 
real vector_product (int n, real *x, real *y)
 
realvector_saxpy (int n, real *x, real *y, real beta)
 
realvector_saxpy2 (int n, real *x, real *y, real beta)
 
void vector_take (int n, real *v, int m, int *p, real **u)
 
void vector_float_take (int n, float *v, int m, int *p, float **u)
 
void vector_ordering (int n, real *v, int **p, int ascending)
 
void vector_sort_real (int n, real *v, int ascending)
 
void vector_sort_int (int n, int *v, int ascending)
 
real vector_median (int n, real *x)
 
real vector_percentile (int n, real *x, real y)
 
void vector_print (char *s, int n, real *x)
 
int excute_system_command3 (char *s1, char *s2, char *s3)
 
int excute_system_command (char *s1, char *s2)
 
real distance (real *x, int dim, int i, int j)
 
real distance_cropped (real *x, int dim, int i, int j)
 
real point_distance (real *p1, real *p2, int dim)
 
char * strip_dir (char *s)
 
void scale_to_box (real xmin, real ymin, real xmax, real ymax, int n, int dim, real *x)
 
int validQ_int_string (char *to_convert, int *v)
 
int digitsQ (char *to_convert)
 

Macro Definition Documentation

#define clear_flag (   a,
  flag 
)    ((a) &=(~(flag)))

Definition at line 38 of file general.h.

Referenced by SparseMatrix_remove_upper().

#define FREE   free

Definition at line 73 of file general.h.

#define MACHINEACC   1.0e-16

Definition at line 120 of file general.h.

Referenced by SparseMatrix_page_rank(), and uniform_stress().

#define MALLOC   gmalloc

Definition at line 69 of file general.h.

#define MEMCPY   memcpy

Definition at line 74 of file general.h.

#define MINDIST   1.e-15

Definition at line 127 of file general.h.

#define NDEBUG   /* switch off assert*/

Definition at line 78 of file general.h.

#define real   double

Definition at line 34 of file general.h.

Referenced by attached_clustering(), average_edge_length(), call_tri(), call_tri2(), cg(), check_or_realloc_arrays(), check_real_array_size(), comp_ascend(), comp_descend(), comp_real(), distance(), distance_cropped(), DistanceMatrix_restrict_cluster(), drand(), edgelist_export(), export_embedding(), get_angle(), get_distance_matrix(), get_stress(), getSizes(), hue2rgb(), hue2rgb_real(), ideal_distance_matrix(), Import_coord_clusters_from_dot(), interpolate_coord(), jacobi(), main(), makeDotGraph(), makeMatrix(), Multilevel_coarsen(), Multilevel_MQ_Clustering_establish(), Multilevel_MQ_Clustering_init(), Operator_diag_precon_apply(), Operator_diag_precon_new(), Operator_uniform_stress_diag_precon_new(), Operator_uniform_stress_matmul_apply(), pcp_rotate(), point_distance(), post_process_smoothing(), QuadTree_get_supernodes(), QuadTree_get_supernodes_internal(), QuadTree_new(), QuadTree_new_from_point_list(), scale_to_box(), SparseMatrix_add(), SparseMatrix_apply_fun(), SparseMatrix_apply_fun_general(), SparseMatrix_crop(), SparseMatrix_distance_matrix(), SparseMatrix_distance_matrix_k_centers(), SparseMatrix_distance_matrix_khops(), SparseMatrix_divide_row_by_degree(), SparseMatrix_from_dense(), SparseMatrix_get_real_adjacency_matrix_symmetrized(), SparseMatrix_get_submatrix(), SparseMatrix_import_dot(), SparseMatrix_is_symmetric(), SparseMatrix_k_centers(), SparseMatrix_k_centers_user(), SparseMatrix_multiply(), SparseMatrix_multiply3(), SparseMatrix_multiply_by_scaler(), SparseMatrix_multiply_vector(), SparseMatrix_normalize_by_row(), SparseMatrix_normalize_to_rowsum1(), SparseMatrix_page_rank(), SparseMatrix_print_coord(), SparseMatrix_print_csr(), SparseMatrix_pseudo_diameter_unweighted(), SparseMatrix_pseudo_diameter_weighted(), SparseMatrix_remove_diagonal(), SparseMatrix_remove_upper(), SparseMatrix_scaled_by_vector(), SparseMatrix_set_entries_to_real_one(), SparseMatrix_solve(), SparseMatrix_sum_repeat_entries(), SparseMatrix_to_complex(), SparseMatrix_transpose(), SparseStressMajorizationSmoother_new(), spring_electrical_embedding(), spring_electrical_embedding_fast(), spring_electrical_embedding_slow(), spring_electrical_spring_embedding(), spring_maxent_embedding(), SpringSmoother_new(), stress_model_core(), StressMajorizationSmoother2_new(), StressMajorizationSmoother_smooth(), tree_map(), TriangleSmoother_new(), uniform_stress(), UniformStressSmoother_new(), vector_median(), vector_ordering(), vector_percentile(), vector_product(), vector_sort_real(), and vector_take().

#define REALLOC   grealloc

Definition at line 70 of file general.h.

#define set_flag (   a,
  flag 
)    ((a)=((a)|(flag)))

Definition at line 36 of file general.h.

#define SQRT_MACHINEACC   1.0e-8

Definition at line 121 of file general.h.

#define test_flag (   a,
  flag 
)    ((a)&(flag))

Definition at line 37 of file general.h.

Enumeration Type Documentation

anonymous enum
Enumerator
UNMATCHED 

Definition at line 129 of file general.h.

Function Documentation

int digitsQ ( char *  to_convert)

Definition at line 347 of file general.c.

real distance ( real x,
int  dim,
int  i,
int  j 
)
real distance_cropped ( real x,
int  dim,
int  i,
int  j 
)

Definition at line 27 of file layout_similarity.c.

real drand ( void  )
int excute_system_command ( char *  s1,
char *  s2 
)

Definition at line 267 of file general.c.

int excute_system_command3 ( char *  s1,
char *  s2,
char *  s3 
)

Definition at line 258 of file general.c.

int irand ( int  n)

Definition at line 56 of file general.c.

References assert.

Referenced by random_permutation().

real point_distance ( real p1,
real p2,
int  dim 
)

Definition at line 291 of file general.c.

int* random_permutation ( int  n)

Definition at line 63 of file general.c.

References irand(), MALLOC, and NULL.

void scale_to_box ( real  xmin,
real  ymin,
real  xmax,
real  ymax,
int  n,
int  dim,
real x 
)

Definition at line 312 of file general.c.

References MAX, max, MIN, real, xmin, and ymin.

char* strip_dir ( char *  s)

Definition at line 299 of file general.c.

References FALSE, and TRUE.

Referenced by dump_coordinates(), and makeDotGraph().

int validQ_int_string ( char *  to_convert,
int v 
)

Definition at line 354 of file general.c.

References int, INT_MAX, and INT_MIN.

real* vector_add_to ( int  n,
real x,
real y 
)

Definition at line 94 of file general.c.

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

Definition at line 145 of file general.c.

References assert, and MALLOC.

real vector_median ( int  n,
real x 
)

Definition at line 21 of file general.c.

References FREE, NULL, real, TRUE, and vector_ordering().

void vector_ordering ( int  n,
real v,
int **  p,
int  ascending 
)

Definition at line 210 of file general.c.

References comp_ascend(), comp_descend(), FREE, int, MALLOC, and real.

Referenced by vector_median(), and vector_percentile().

real vector_percentile ( int  n,
real x,
real  y 
)

Definition at line 35 of file general.c.

References FREE, MAX, MIN, NULL, real, TRUE, and vector_ordering().

void vector_print ( char *  s,
int  n,
real x 
)

Definition at line 122 of file general.c.

real vector_product ( int  n,
real x,
real y 
)

Definition at line 101 of file general.c.

References real.

Referenced by StressMajorizationSmoother_smooth().

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

Definition at line 108 of file general.c.

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

Definition at line 115 of file general.c.

void vector_sort_int ( int  n,
int v,
int  ascending 
)

Definition at line 250 of file general.c.

References comp_ascend_int(), and comp_descend_int().

void vector_sort_real ( int  n,
real v,
int  ascending 
)

Definition at line 243 of file general.c.

References comp_ascend(), comp_descend(), and real.

real* vector_subtract_from ( int  n,
real x,
real y 
)

Definition at line 82 of file general.c.

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

Definition at line 88 of file general.c.

void vector_take ( int  n,
real v,
int  m,
int p,
real **  u 
)

Definition at line 132 of file general.c.

References assert, MALLOC, and real.