Graphviz 16.1.1~dev.20261101.1716
Loading...
Searching...
No Matches
hierarchy.h
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v2.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#pragma once
12
14#include <stdbool.h>
15#include <stddef.h>
16
17typedef struct {
18 int nedges; // degree, including self-loop
19 int *edges; // neighbors; edges[0] = self
20 int size; // no. of original nodes contained
21 int active_level; // Node displayed iff active_level == node's level
22
23 // position of node in universal coordinate system
24 float x_coord;
25 float y_coord;
26
27 // position of node in physical (device) coordinate system
30 //previous coords and active level (for animation)
34
35
37
38typedef struct {
42 int * nvtxs;
43 int * nedges;
44 /* Node i on level k is mapped to coarse node v2cv[k][i] on level k+1
45 */
46 int ** v2cv;
47 /* Coarse node i on level k contains nodes cv2v[k][2*i] and
48 * cv2v[k][2*i+1] on level k-1. If it contains only 1 node, then
49 * cv2v[k][2*i+1] will be -1
50 */
51 int ** cv2v;
52} Hierarchy;
53
54typedef struct {
55 int num_fine_nodes; /* 50 */
56 double coarsening_rate; /* 2.5 */
58
60 ex_vtx_data *geom_graph, int ngeom_edges,
61 bool dist2_limit);
62
63void set_active_levels(Hierarchy*, int*, int, levelparms_t*);
64void find_closest_active_node(Hierarchy*, double x, double y, int*);
65
66size_t extract_active_logical_coords(Hierarchy *hierarchy, int node, int level,
67 double *x_coords, double *y_coords, size_t counter);
68int set_active_physical_coords(Hierarchy *, int node, int level,
69 double *x_coords, double *y_coords, int counter);
70
71void init_active_level(Hierarchy* hierarchy);
72
73// creating a geometric graph:
74int init_ex_graph(v_data * graph1, v_data * graph2, int n,
75 double *x_coords, double *y_coords, ex_vtx_data ** gp);
76
77// layout distortion:
78void rescale_layout_polar(double * x_coords, double * y_coords,
79 double * x_foci, double * y_foci, int num_foci, size_t n, int interval,
80 double width, double height, double distortion);
81
82void find_physical_coords(Hierarchy *, int, int, float *x, float *y);
83void find_old_physical_coords(Hierarchy *hierarchy, int level, int node,
84 float *x, float *y);
85
86void find_active_ancestor_info(Hierarchy * hierarchy, int level, int node, int *levell,int *nodee);
87
88void quicksort_place(double *place, int *ordering, size_t size);
Agraph_t * graph(char *name)
Definition gv.cpp:34
void init_active_level(Hierarchy *hierarchy)
Definition hierarchy.c:1081
size_t extract_active_logical_coords(Hierarchy *hierarchy, int node, int level, double *x_coords, double *y_coords, size_t counter)
Definition hierarchy.c:974
Hierarchy * create_hierarchy(v_data *graph, int nvtxs, int nedges, ex_vtx_data *geom_graph, int ngeom_edges, bool dist2_limit)
Definition hierarchy.c:668
void set_active_levels(Hierarchy *, int *, int, levelparms_t *)
Definition hierarchy.c:743
void find_old_physical_coords(Hierarchy *hierarchy, int level, int node, float *x, float *y)
Definition hierarchy.c:1069
void find_closest_active_node(Hierarchy *, double x, double y, int *)
Definition hierarchy.c:906
void find_active_ancestor_info(Hierarchy *hierarchy, int level, int node, int *levell, int *nodee)
Definition hierarchy.c:1051
void find_physical_coords(Hierarchy *, int, int, float *x, float *y)
Definition hierarchy.c:1038
void rescale_layout_polar(double *x_coords, double *y_coords, double *x_foci, double *y_foci, int num_foci, size_t n, int interval, double width, double height, double distortion)
void quicksort_place(double *place, int *ordering, size_t size)
int set_active_physical_coords(Hierarchy *, int node, int level, double *x_coords, double *y_coords, int counter)
Definition hierarchy.c:1008
int init_ex_graph(v_data *graph1, v_data *graph2, int n, double *x_coords, double *y_coords, ex_vtx_data **gp)
Definition hierarchy.c:921
static int nedges
total no. of edges used in routing
Definition routespl.c:33
v_data ** graphs
Definition hierarchy.h:40
int * nvtxs
Definition hierarchy.h:42
int ** cv2v
Definition hierarchy.h:51
int * nedges
Definition hierarchy.h:43
ex_vtx_data ** geom_graphs
Definition hierarchy.h:41
int nlevels
Definition hierarchy.h:39
int ** v2cv
Definition hierarchy.h:46
float physical_y_coord
Definition hierarchy.h:29
float old_physical_y_coord
Definition hierarchy.h:32
float old_physical_x_coord
Definition hierarchy.h:31
int old_active_level
Definition hierarchy.h:33
float physical_x_coord
Definition hierarchy.h:28
float x_coord
Definition hierarchy.h:24
int active_level
Definition hierarchy.h:21
float y_coord
Definition hierarchy.h:25
int * edges
Definition hierarchy.h:19
int num_fine_nodes
Definition hierarchy.h:55
double coarsening_rate
Definition hierarchy.h:56