Graphviz
2.41.20171026.1811
|
#include "config.h"
#include "SparseMatrix.h"
#include "spring_electrical.h"
#include "QuadTree.h"
#include "Multilevel.h"
#include "post_process.h"
#include "overlap.h"
#include "types.h"
#include "memory.h"
#include "arith.h"
#include "logic.h"
#include "math.h"
#include "globals.h"
#include <string.h>
#include <time.h>
Go to the source code of this file.
Macros | |
#define | PI M_PI |
#define | node_degree(i) (ia[(i)+1] - ia[(i)]) |
#define node_degree | ( | i | ) | (ia[(i)+1] - ia[(i)]) |
Definition at line 317 of file spring_electrical.c.
#define PI M_PI |
Definition at line 31 of file spring_electrical.c.
Referenced by get_angle().
real average_edge_length | ( | SparseMatrix | A, |
int | dim, | ||
real * | coord | ||
) |
Definition at line 162 of file spring_electrical.c.
References assert, dist(), SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, real, SparseMatrix_is_symmetric(), and TRUE.
Referenced by spring_electrical_embedding(), spring_electrical_embedding_fast(), spring_electrical_embedding_slow(), and spring_electrical_spring_embedding().
Definition at line 326 of file spring_electrical.c.
Definition at line 319 of file spring_electrical.c.
int comp_real | ( | const void * | x, |
const void * | y | ||
) |
Definition at line 355 of file spring_electrical.c.
References real.
void export_embedding | ( | FILE * | fp, |
int | dim, | ||
SparseMatrix | A, | ||
real * | x, | ||
real * | width | ||
) |
Definition at line 218 of file spring_electrical.c.
References SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MAX, MIN, real, xmax, xmin, ymax, and ymin.
Referenced by spring_electrical_embedding(), spring_electrical_embedding_slow(), spring_electrical_spring_embedding(), and spring_maxent_embedding().
Definition at line 451 of file spring_electrical.c.
Definition at line 334 of file spring_electrical.c.
void interpolate_coord | ( | int | dim, |
SparseMatrix | A, | ||
real * | x | ||
) |
Definition at line 1789 of file spring_electrical.c.
References alpha, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, and real.
void multilevel_spring_electrical_embedding | ( | int | dim, |
SparseMatrix | A, | ||
SparseMatrix | D, | ||
spring_electrical_control | ctrl, | ||
real * | node_weights, | ||
real * | label_sizes, | ||
real * | x, | ||
int | n_edge_label_nodes, | ||
int * | edge_label_nodes, | ||
int * | flag | ||
) |
Definition at line 2283 of file spring_electrical.c.
void oned_optimizer_delete | ( | oned_optimizer | opt | ) |
Definition at line 107 of file spring_electrical.c.
References FREE.
Referenced by spring_electrical_embedding(), spring_electrical_embedding_fast(), and spring_electrical_embedding_slow().
int oned_optimizer_get | ( | oned_optimizer | opt | ) |
Definition at line 157 of file spring_electrical.c.
References oned_optimizer_struct::i.
Referenced by spring_electrical_embedding(), spring_electrical_embedding_fast(), and spring_electrical_embedding_slow().
oned_optimizer oned_optimizer_new | ( | int | i | ) |
Definition at line 111 of file spring_electrical.c.
References oned_optimizer_struct::direction, oned_optimizer_struct::i, MALLOC, and OPT_INIT.
Referenced by spring_electrical_embedding(), spring_electrical_embedding_fast(), and spring_electrical_embedding_slow().
void oned_optimizer_train | ( | oned_optimizer | opt, |
real | work | ||
) |
Definition at line 119 of file spring_electrical.c.
References assert, oned_optimizer_struct::direction, oned_optimizer_struct::i, MAX, MAX_I, MIN, OPT_DOWN, OPT_INIT, OPT_UP, and oned_optimizer_struct::work.
Referenced by spring_electrical_embedding(), spring_electrical_embedding_fast(), and spring_electrical_embedding_slow().
Definition at line 1858 of file spring_electrical.c.
int power_law_graph | ( | SparseMatrix | A | ) |
Definition at line 1834 of file spring_electrical.c.
References FALSE, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, MAX, max, and TRUE.
Definition at line 1746 of file spring_electrical.c.
void spring_electrical_control_delete | ( | spring_electrical_control | ctrl | ) |
Definition at line 73 of file spring_electrical.c.
References FREE.
Referenced by sfdp_layout(), and SpringSmoother_delete().
spring_electrical_control spring_electrical_control_new | ( | void | ) |
Definition at line 33 of file spring_electrical.c.
References spring_electrical_control_struct::adaptive_cooling, AUTOP, spring_electrical_control_struct::beautify_leaves, spring_electrical_control_struct::bh, spring_electrical_control_struct::C, COARSEN_INDEPENDENT_EDGE_SET_HEAVEST_EDGE_PERNODE_SUPERNODES_FIRST, COARSEN_MODE_FORCEFUL, spring_electrical_control_struct::cool, spring_electrical_control_struct::do_shrinking, spring_electrical_control_struct::edge_labeling_scheme, FALSE, spring_electrical_control_struct::initial_scaling, spring_electrical_control_struct::K, MALLOC, spring_electrical_control_struct::max_qtree_level, spring_electrical_control_struct::maxiter, spring_electrical_control_struct::method, METHOD_SPRING_ELECTRICAL, spring_electrical_control_struct::multilevel_coarsen_mode, spring_electrical_control_struct::multilevel_coarsen_scheme, spring_electrical_control_struct::multilevels, spring_electrical_control_struct::overlap, spring_electrical_control_struct::p, spring_electrical_control_struct::q, QUAD_TREE_HYBRID, spring_electrical_control_struct::quadtree_size, spring_electrical_control_struct::random_seed, spring_electrical_control_struct::random_start, spring_electrical_control_struct::rotation, spring_electrical_control_struct::smoothing, SMOOTHING_NONE, spring_electrical_control_struct::step, spring_electrical_control_struct::tol, TRUE, spring_electrical_control_struct::tscheme, and spring_electrical_control_struct::use_node_weights.
Referenced by sfdp_layout(), and SpringSmoother_new().
void spring_electrical_control_print | ( | spring_electrical_control | ctrl | ) |
Definition at line 89 of file spring_electrical.c.
References spring_electrical_control_struct::adaptive_cooling, spring_electrical_control_struct::beautify_leaves, spring_electrical_control_struct::bh, spring_electrical_control_struct::C, spring_electrical_control_struct::cool, spring_electrical_control_struct::do_shrinking, spring_electrical_control_struct::edge_labeling_scheme, spring_electrical_control_struct::initial_scaling, spring_electrical_control_struct::K, spring_electrical_control_struct::max_qtree_level, spring_electrical_control_struct::maxiter, spring_electrical_control_struct::method, spring_electrical_control_struct::multilevel_coarsen_mode, spring_electrical_control_struct::multilevel_coarsen_scheme, spring_electrical_control_struct::multilevels, spring_electrical_control_struct::overlap, spring_electrical_control_struct::p, spring_electrical_control_struct::q, spring_electrical_control_struct::quadtree_size, spring_electrical_control_struct::random_seed, spring_electrical_control_struct::random_start, spring_electrical_control_struct::rotation, spring_electrical_control_struct::smoothing, spring_electrical_control_struct::step, spring_electrical_control_struct::tol, spring_electrical_control_struct::tscheme, and spring_electrical_control_struct::use_node_weights.
Referenced by sfdp_layout().
void spring_electrical_embedding | ( | int | dim, |
SparseMatrix | A0, | ||
spring_electrical_control | ctrl, | ||
real * | node_weights, | ||
real * | x, | ||
int * | flag | ||
) |
Definition at line 948 of file spring_electrical.c.
References spring_electrical_control_struct::adaptive_cooling, assert, average_edge_length(), spring_electrical_control_struct::beautify_leaves, spring_electrical_control_struct::bh, C, spring_electrical_control_struct::C, spring_electrical_control_struct::cool, dist(), distance(), distance_cropped(), drand(), ERROR_NOT_SQUARE_MATRIX, export_embedding(), FALSE, SparseMatrix_struct::format, FORMAT_CSR, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, spring_electrical_control_struct::K, SparseMatrix_struct::m, MALLOC, MAX, spring_electrical_control_struct::max_qtree_level, spring_electrical_control_struct::maxiter, MEMCPY, MINDIST, SparseMatrix_struct::n, NULL, SparseMatrix_struct::nz, oned_optimizer_delete(), oned_optimizer_get(), oned_optimizer_new(), oned_optimizer_train(), spring_electrical_control_struct::p, QuadTree_delete(), QuadTree_get_supernodes(), QuadTree_new_from_point_list(), spring_electrical_control_struct::quadtree_size, spring_electrical_control_struct::random_seed, spring_electrical_control_struct::random_start, real, SparseMatrix_delete(), SparseMatrix_symmetrize(), spring_electrical_control_struct::step, spring_electrical_control_struct::tol, TRUE, spring_electrical_control_struct::use_node_weights, and Verbose.
void spring_electrical_embedding_fast | ( | int | dim, |
SparseMatrix | A0, | ||
spring_electrical_control | ctrl, | ||
real * | node_weights, | ||
real * | x, | ||
int * | flag | ||
) |
Definition at line 488 of file spring_electrical.c.
References spring_electrical_control_struct::adaptive_cooling, assert, average_edge_length(), spring_electrical_control_struct::beautify_leaves, spring_electrical_control_struct::bh, C, spring_electrical_control_struct::C, spring_electrical_control_struct::cool, dist(), distance(), drand(), ERROR_NOT_SQUARE_MATRIX, SparseMatrix_struct::format, FORMAT_CSR, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, spring_electrical_control_struct::K, SparseMatrix_struct::m, MALLOC, spring_electrical_control_struct::max_qtree_level, spring_electrical_control_struct::maxiter, MEMCPY, SparseMatrix_struct::n, NULL, SparseMatrix_struct::nz, oned_optimizer_delete(), oned_optimizer_get(), oned_optimizer_new(), oned_optimizer_train(), spring_electrical_control_struct::p, QuadTree_delete(), QuadTree_get_repulsive_force(), QuadTree_new_from_point_list(), spring_electrical_control_struct::random_seed, spring_electrical_control_struct::random_start, real, SparseMatrix_delete(), SparseMatrix_symmetrize(), spring_electrical_control_struct::step, spring_electrical_control_struct::tol, TRUE, spring_electrical_control_struct::use_node_weights, and Verbose.
void spring_electrical_embedding_slow | ( | int | dim, |
SparseMatrix | A0, | ||
spring_electrical_control | ctrl, | ||
real * | node_weights, | ||
real * | x, | ||
int * | flag | ||
) |
Definition at line 686 of file spring_electrical.c.
References spring_electrical_control_struct::adaptive_cooling, assert, average_edge_length(), spring_electrical_control_struct::beautify_leaves, spring_electrical_control_struct::bh, C, spring_electrical_control_struct::C, spring_electrical_control_struct::cool, dist(), distance(), distance_cropped(), drand(), ERROR_NOT_SQUARE_MATRIX, export_embedding(), FALSE, SparseMatrix_struct::format, FORMAT_CSR, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, spring_electrical_control_struct::K, SparseMatrix_struct::m, MALLOC, MAX, spring_electrical_control_struct::max_qtree_level, spring_electrical_control_struct::maxiter, MEMCPY, MINDIST, SparseMatrix_struct::n, NULL, SparseMatrix_struct::nz, oned_optimizer_delete(), oned_optimizer_get(), oned_optimizer_new(), oned_optimizer_train(), spring_electrical_control_struct::p, QuadTree_delete(), QuadTree_get_supernodes(), QuadTree_new_from_point_list(), spring_electrical_control_struct::quadtree_size, spring_electrical_control_struct::random_seed, spring_electrical_control_struct::random_start, real, SparseMatrix_delete(), SparseMatrix_symmetrize(), spring_electrical_control_struct::step, spring_electrical_control_struct::tol, TRUE, spring_electrical_control_struct::use_node_weights, and Verbose.
void spring_electrical_spring_embedding | ( | int | dim, |
SparseMatrix | A0, | ||
SparseMatrix | D, | ||
spring_electrical_control | ctrl, | ||
real * | node_weights, | ||
real * | x, | ||
int * | flag | ||
) |
Definition at line 1535 of file spring_electrical.c.
References SparseMatrix_struct::a, spring_electrical_control_struct::adaptive_cooling, assert, average_edge_length(), spring_electrical_control_struct::beautify_leaves, spring_electrical_control_struct::bh, C, spring_electrical_control_struct::C, spring_electrical_control_struct::cool, dist(), distance(), distance_cropped(), drand(), ERROR_NOT_SQUARE_MATRIX, export_embedding(), FALSE, SparseMatrix_struct::format, FORMAT_CSR, FREE, SparseMatrix_struct::ia, if(), SparseMatrix_struct::ja, spring_electrical_control_struct::K, SparseMatrix_struct::m, MALLOC, MAX, spring_electrical_control_struct::maxiter, MEMCPY, MINDIST, SparseMatrix_struct::n, NULL, SparseMatrix_struct::nz, spring_electrical_control_struct::p, QuadTree_delete(), QuadTree_get_supernodes(), QuadTree_new_from_point_list(), spring_electrical_control_struct::quadtree_size, spring_electrical_control_struct::random_seed, spring_electrical_control_struct::random_start, real, SparseMatrix_delete(), SparseMatrix_symmetrize(), spring_electrical_control_struct::step, spring_electrical_control_struct::tol, TRUE, spring_electrical_control_struct::use_node_weights, and Verbose.
Referenced by SpringSmoother_smooth().
void spring_maxent_embedding | ( | int | dim, |
SparseMatrix | A0, | ||
SparseMatrix | D, | ||
spring_electrical_control | ctrl, | ||
real * | node_weights, | ||
real * | x, | ||
real | rho, | ||
int * | flag | ||
) |
Definition at line 1258 of file spring_electrical.c.
References SparseMatrix_struct::a, spring_electrical_control_struct::adaptive_cooling, assert, spring_electrical_control_struct::beautify_leaves, spring_electrical_control_struct::bh, C, spring_electrical_control_struct::C, spring_electrical_control_struct::cool, dist(), distance_cropped(), drand(), ERROR_NOT_SQUARE_MATRIX, export_embedding(), FALSE, SparseMatrix_struct::format, FORMAT_CSR, FREE, SparseMatrix_struct::ia, if(), SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, MAX, spring_electrical_control_struct::maxiter, MEMCPY, MINDIST, SparseMatrix_struct::n, NULL, SparseMatrix_struct::nz, spring_electrical_control_struct::p, spring_electrical_control_struct::q, QUAD_TREE_NONE, QuadTree_delete(), QuadTree_get_supernodes(), QuadTree_new_from_point_list(), spring_electrical_control_struct::quadtree_size, spring_electrical_control_struct::random_seed, spring_electrical_control_struct::random_start, real, SparseMatrix_delete(), SparseMatrix_symmetrize(), spring_electrical_control_struct::step, spring_electrical_control_struct::tol, TRUE, spring_electrical_control_struct::tscheme, spring_electrical_control_struct::use_node_weights, and Verbose.