Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
kkutils.c File Reference
#include <neatogen/bfs.h>
#include <neatogen/dijkstra.h>
#include <neatogen/kkutils.h>
#include <stdlib.h>
#include <math.h>
#include <util/alloc.h>
#include <util/sort.h>
Include dependency graph for kkutils.c:

Go to the source code of this file.

Functions

size_t common_neighbors (vtx_data *graph, int u, int *v_vector)
 
void fill_neighbors_vec_unweighted (vtx_data *graph, int vtx, int *vtx_vec)
 
void empty_neighbors_vec (vtx_data *graph, int vtx, int *vtx_vec)
 
static DistType ** compute_apsp_dijkstra (vtx_data *graph, int n)
 
static DistType ** compute_apsp_simple (vtx_data *graph, int n)
 
DistType ** compute_apsp (vtx_data *graph, int n)
 
DistType ** compute_apsp_artificial_weights (vtx_data *graph, int n)
 
double distance_kD (double **coords, int dim, int i, int j)
 
static int fcmpf (const void *a, const void *b, void *context)
 
void quicksort_placef (float *place, int *ordering, int first, int last)
 
static int cmp (const void *a, const void *b, void *context)
 
void quicksort_place (double *place, int *ordering, int size)
 
void compute_new_weights (vtx_data *graph, int n)
 
void restore_old_weights (vtx_data *graph, int n, float *old_weights)
 

Function Documentation

◆ cmp()

static int cmp ( const void *  a,
const void *  b,
void *  context 
)
static

Definition at line 147 of file kkutils.c.

Referenced by quicksort_place().

Here is the caller graph for this function:

◆ common_neighbors()

size_t common_neighbors ( vtx_data graph,
int  u,
int *  v_vector 
)

Definition at line 19 of file kkutils.c.

References graph(), and neighbor.

Referenced by compute_apsp_artificial_weights_packed(), and compute_new_weights().

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

◆ compute_apsp()

DistType ** compute_apsp ( vtx_data graph,
int  n 
)

Definition at line 85 of file kkutils.c.

References compute_apsp_dijkstra(), compute_apsp_simple(), and graph().

Here is the call graph for this function:

◆ compute_apsp_artificial_weights()

DistType ** compute_apsp_artificial_weights ( vtx_data graph,
int  n 
)

Definition at line 93 of file kkutils.c.

References compute_apsp_dijkstra(), compute_new_weights(), graph(), and restore_old_weights().

Referenced by subset_model().

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

◆ compute_apsp_dijkstra()

static DistType ** compute_apsp_dijkstra ( vtx_data graph,
int  n 
)
static

Definition at line 53 of file kkutils.c.

References dijkstra(), graph(), and gv_calloc().

Referenced by compute_apsp(), and compute_apsp_artificial_weights().

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

◆ compute_apsp_simple()

static DistType ** compute_apsp_simple ( vtx_data graph,
int  n 
)
static

Definition at line 68 of file kkutils.c.

References bfs(), graph(), and gv_calloc().

Referenced by compute_apsp().

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

◆ compute_new_weights()

void compute_new_weights ( vtx_data graph,
int  n 
)

Definition at line 165 of file kkutils.c.

References common_neighbors(), empty_neighbors_vec(), fill_neighbors_vec_unweighted(), free(), graph(), gv_calloc(), nedges, and neighbor.

Referenced by compute_apsp_artificial_weights(), embed_graph(), and sparse_stress_subspace_majorization_kD().

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

◆ distance_kD()

double distance_kD ( double **  coords,
int  dim,
int  i,
int  j 
)

Definition at line 113 of file kkutils.c.

References dim.

Referenced by sparse_stress_subspace_majorization_kD().

Here is the caller graph for this function:

◆ empty_neighbors_vec()

void empty_neighbors_vec ( vtx_data graph,
int  vtx,
int *  vtx_vec 
)

Definition at line 41 of file kkutils.c.

References graph().

Referenced by compute_apsp_artificial_weights_packed(), and compute_new_weights().

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

◆ fcmpf()

static int fcmpf ( const void *  a,
const void *  b,
void *  context 
)
static

Definition at line 125 of file kkutils.c.

Referenced by quicksort_placef().

Here is the caller graph for this function:

◆ fill_neighbors_vec_unweighted()

void fill_neighbors_vec_unweighted ( vtx_data graph,
int  vtx,
int *  vtx_vec 
)

Definition at line 32 of file kkutils.c.

References graph().

Referenced by compute_apsp_artificial_weights_packed(), and compute_new_weights().

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

◆ quicksort_place()

void quicksort_place ( double *  place,
int *  ordering,
int  size 
)

Definition at line 161 of file kkutils.c.

References cmp(), and gv_sort().

Here is the call graph for this function:

◆ quicksort_placef()

void quicksort_placef ( float *  place,
int *  ordering,
int  first,
int  last 
)

Definition at line 140 of file kkutils.c.

References fcmpf(), gv_sort(), and last.

Here is the call graph for this function:

◆ restore_old_weights()

void restore_old_weights ( vtx_data graph,
int  n,
float *  old_weights 
)

Definition at line 196 of file kkutils.c.

References free(), graph(), and NULL.

Referenced by compute_apsp_artificial_weights(), embed_graph(), and sparse_stress_subspace_majorization_kD().

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