Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
edge_bundling.cpp File Reference
#include <algorithm>
#include <common/types.h>
#include <common/globals.h>
#include <sparse/general.h>
#include <math.h>
#include <sparse/SparseMatrix.h>
#include <mingle/edge_bundling.h>
#include <time.h>
#include <sparse/clustering.h>
#include <mingle/ink.h>
#include <mingle/agglomerative_bundling.h>
#include <string.h>
#include <vector>
Include dependency graph for edge_bundling.cpp:

Go to the source code of this file.

Macros

#define SMALL   1.e-10
 

Functions

static double norm (int n, const double *x)
 
static double sqr_dist (int dim, const double *x, const double *y)
 
static double dist (int dim, const double *x, const double *y)
 
static pedge pedge_new (int np, int dim, const double *x)
 
pedge pedge_wgt_new (int np, int dim, double *x, double wgt)
 
void pedge_delete (pedge &)
 
static double edge_compatibility (const pedge &e1, const pedge &e2)
 
static double edge_compatibility_full (const pedge &e1, const pedge &e2)
 
static void fprint_rgb (FILE *fp, int r, int g, int b, int alpha)
 
void pedge_export_gv (FILE *fp, int ne, const std::vector< pedge > &edges)
 
void pedge_wgts_realloc (pedge &e, int n)
 
void pedge_double (pedge &e)
 
static void edge_tension_force (std::vector< double > &force, const pedge &e)
 
static void edge_attraction_force (double similarity, const pedge &e1, const pedge &e2, std::vector< double > &force)
 
static void force_directed_edge_bundling (SparseMatrix A, std::vector< pedge > &edges, int maxit, double step0, double K)
 
static void modularity_ink_bundling (int dim, int ne, SparseMatrix B, std::vector< pedge > &edges, double angle_param, double angle)
 
static SparseMatrix check_compatibility (SparseMatrix A, int ne, const std::vector< pedge > &edges, int compatibility_method, double tol)
 
std::vector< pedgeedge_bundling (SparseMatrix A0, int dim, const std::vector< double > &x, int maxit_outer, double K, int method, int nneighbor, int compatibility_method, int max_recursion, double angle_param, double angle)
 

Macro Definition Documentation

◆ SMALL

#define SMALL   1.e-10

Definition at line 25 of file edge_bundling.cpp.

Function Documentation

◆ check_compatibility()

static SparseMatrix check_compatibility ( SparseMatrix  A,
int  ne,
const std::vector< pedge > &  edges,
int  compatibility_method,
double  tol 
)
static

Definition at line 507 of file edge_bundling.cpp.

References A, B, C, COMPATIBILITY_DIST, COMPATIBILITY_FULL, dist(), edge_compatibility(), edge_compatibility_full(), FORMAT_COORD, MATRIX_TYPE_REAL, SparseMatrix_coordinate_form_add_entry(), SparseMatrix_delete(), SparseMatrix_from_coordinate_format(), SparseMatrix_new(), tol, and Verbose.

Referenced by edge_bundling().

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

◆ dist()

static double dist ( int  dim,
const double *  x,
const double *  y 
)
static

Definition at line 43 of file edge_bundling.cpp.

References dim, and sqr_dist().

Referenced by check_compatibility(), edge_attraction_force(), edge_compatibility(), edge_compatibility_full(), pedge_double(), pedge_new(), and pedge_wgt_new().

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

◆ edge_attraction_force()

static void edge_attraction_force ( double  similarity,
const pedge e1,
const pedge e2,
std::vector< double > &  force 
)
static

Definition at line 365 of file edge_bundling.cpp.

References pedge::dim, dim, dist(), pedge::edge_length, pedge::npoints, SMALL, sqr_dist(), and pedge::x.

Referenced by force_directed_edge_bundling().

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

◆ edge_bundling()

std::vector< pedge > edge_bundling ( SparseMatrix  A0,
int  dim,
const std::vector< double > &  x,
int  maxit_outer,
double  K,
int  method,
int  nneighbor,
int  compatibility_method,
int  max_recursion,
double  angle_param,
double  angle 
)

Definition at line 543 of file edge_bundling.cpp.

References A, agglomerative_ink_bundling(), B, check_compatibility(), dim, force_directed_edge_bundling(), SparseMatrix_struct::m, maxit, METHOD_FD, METHOD_INK, METHOD_INK_AGGLOMERATE, METHOD_NONE, modularity_ink_bundling(), NULL, pedge_double(), pedge_new(), SparseMatrix_delete(), SparseMatrix_symmetrize(), tol, and Verbose.

Referenced by bundle().

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

◆ edge_compatibility()

static double edge_compatibility ( const pedge e1,
const pedge e2 
)
static

Definition at line 75 of file edge_bundling.cpp.

References pedge::dim, dim, dist(), dist2(), pedge::npoints, sqr_dist(), and pedge::x.

Referenced by check_compatibility().

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

◆ edge_compatibility_full()

static double edge_compatibility_full ( const pedge e1,
const pedge e2 
)
static

Definition at line 104 of file edge_bundling.cpp.

References pedge::dim, dim, dist(), dist2(), len(), pedge::npoints, SMALL, sqr_dist(), and pedge::x.

Referenced by check_compatibility().

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

◆ edge_tension_force()

static void edge_tension_force ( std::vector< double > &  force,
const pedge e 
)
static

Definition at line 347 of file edge_bundling.cpp.

References pedge::dim, dim, pedge::edge_length, left, pedge::npoints, right, SMALL, and pedge::x.

Referenced by force_directed_edge_bundling().

Here is the caller graph for this function:

◆ force_directed_edge_bundling()

static void force_directed_edge_bundling ( SparseMatrix  A,
std::vector< pedge > &  edges,
int  maxit,
double  step0,
double  K 
)
static

Definition at line 402 of file edge_bundling.cpp.

References A, dim, edge_attraction_force(), pedge::edge_length, edge_tension_force(), maxit, s::n, norm(), SMALL, Verbose, and pedge::x.

Referenced by edge_bundling().

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

◆ fprint_rgb()

static void fprint_rgb ( FILE *  fp,
int  r,
int  g,
int  b,
int  alpha 
)
static

Definition at line 160 of file edge_bundling.cpp.

References alpha.

Referenced by pedge_export_gv().

Here is the caller graph for this function:

◆ modularity_ink_bundling()

static void modularity_ink_bundling ( int  dim,
int  ne,
SparseMatrix  B,
std::vector< pedge > &  edges,
double  angle_param,
double  angle 
)
static

Definition at line 451 of file edge_bundling.cpp.

References B, C, D, dim, FORMAT_COORD, ink(), ink1(), MATRIX_TYPE_PATTERN, modularity_clustering(), pedge::npoints, NULL, pedge_double(), SparseMatrix_apply_fun(), SparseMatrix_coordinate_form_add_entry(), SparseMatrix_copy(), SparseMatrix_delete(), SparseMatrix_from_coordinate_format(), SparseMatrix_new(), Verbose, pedge::x, point_t::x, and point_t::y.

Referenced by edge_bundling().

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

◆ norm()

static double norm ( int  n,
const double *  x 
)
static

Definition at line 27 of file edge_bundling.cpp.

Referenced by force_directed_edge_bundling(), get_12_norm(), get_local_12_norm(), and mapToSphere().

Here is the caller graph for this function:

◆ pedge_delete()

void pedge_delete ( pedge e)

Definition at line 73 of file edge_bundling.cpp.

Referenced by agglomerative_ink_bundling_internal().

Here is the caller graph for this function:

◆ pedge_double()

void pedge_double ( pedge e)

Definition at line 316 of file edge_bundling.cpp.

References pedge::dim, dim, dist(), pedge::edge_length, len(), pedge::len, pedge::npoints, and pedge::x.

Referenced by agglomerative_ink_bundling_internal(), edge_bundling(), and modularity_ink_bundling().

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

◆ pedge_export_gv()

void pedge_export_gv ( FILE *  fp,
int  ne,
const std::vector< pedge > &  edges 
)

Definition at line 164 of file edge_bundling.cpp.

References dim, edge, fprint_rgb(), len(), and pedge::x.

Referenced by bundle().

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

◆ pedge_new()

static pedge pedge_new ( int  np,
int  dim,
const double *  x 
)
static

Definition at line 47 of file edge_bundling.cpp.

References pedge::dim, dim, dist(), pedge::edge_length, pedge::len, pedge::npoints, pedge::wgt, and pedge::x.

Referenced by edge_bundling().

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

◆ pedge_wgt_new()

pedge pedge_wgt_new ( int  np,
int  dim,
double *  x,
double  wgt 
)

Definition at line 60 of file edge_bundling.cpp.

References pedge::dim, dim, dist(), pedge::edge_length, pedge::len, pedge::npoints, pedge::wgt, pedge::wgts, and pedge::x.

Referenced by agglomerative_ink_bundling_internal().

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

◆ pedge_wgts_realloc()

void pedge_wgts_realloc ( pedge e,
int  n 
)

Definition at line 301 of file edge_bundling.cpp.

References pedge::dim, pedge::len, pedge::npoints, pedge::wgt, pedge::wgts, and pedge::x.

Referenced by agglomerative_ink_bundling_internal().

Here is the caller graph for this function:

◆ sqr_dist()

static double sqr_dist ( int  dim,
const double *  x,
const double *  y 
)
static

Definition at line 36 of file edge_bundling.cpp.

References dim.

Referenced by dist(), edge_attraction_force(), edge_compatibility(), and edge_compatibility_full().

Here is the caller graph for this function: