Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
edge_bundling.cpp File Reference
#include "config.h"
#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 27 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 509 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 45 of file edge_bundling.cpp.

References 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 367 of file edge_bundling.cpp.

References pedge::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 545 of file edge_bundling.cpp.

References A, agerrorf(), agglomerative_ink_bundling(), B, check_compatibility(), 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 77 of file edge_bundling.cpp.

References pedge::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 106 of file edge_bundling.cpp.

References pedge::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 349 of file edge_bundling.cpp.

References pedge::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 404 of file edge_bundling.cpp.

References A, 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 162 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 453 of file edge_bundling.cpp.

References B, C, D, 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 29 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 75 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 318 of file edge_bundling.cpp.

References pedge::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 166 of file edge_bundling.cpp.

References 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 49 of file edge_bundling.cpp.

References pedge::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 62 of file edge_bundling.cpp.

References pedge::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 303 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 38 of file edge_bundling.cpp.

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

Here is the caller graph for this function: