Crossings Minimization  1.0
channel.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "graph.h"
#include "min_crossings.h"
#include "heuristics.h"
#include "channel.h"
#include "stretch.h"
#include "random.h"
Include dependency graph for channel.c:

Go to the source code of this file.

Functions

static int count_down_edges (int i)
 
static Channelptr initChannel (int i)
 
void initChannels (void)
 
double totalChannelStretch (int i)
 
double totalLayerStretch (int i)
 
double maxEdgeStretchInChannel (int i)
 
double totalStretch ()
 
double maxEdgeStretch ()
 
Edgeptr maxStretchEdge ()
 

Variables

Channelptrchannels
 

Function Documentation

◆ count_down_edges()

static int count_down_edges ( int  i)
static
Returns
the number of edges between layers i-1 and i

Definition at line 22 of file channel.c.

References node_struct::down_degree, layers, layer_struct::nodes, and layer_struct::number_of_nodes.

Referenced by initChannel().

◆ initChannel()

static Channelptr initChannel ( int  i)
static
Returns
a pointer to the list of edges for channel i and fills in appropriate data: number of edges and the actual edges; note: channel i is between layers i-1 and i

Definition at line 37 of file channel.c.

References count_down_edges(), node_struct::down_degree, node_struct::down_edges, channel_struct::edges, layers, layer_struct::nodes, channel_struct::number_of_edges, and layer_struct::number_of_nodes.

Referenced by initChannels().

Here is the call graph for this function:

◆ initChannels()

void initChannels ( void  )

initializes data structures relevant to channels

Definition at line 57 of file channel.c.

References initChannel(), and number_of_layers.

Referenced by main().

Here is the call graph for this function:

◆ maxEdgeStretch()

double maxEdgeStretch ( )
Returns
the maximum stretch among all edges

Definition at line 126 of file channel.c.

References iteration, maxEdgeStretchInChannel(), and number_of_layers.

Referenced by capture_beginning_stats(), capture_preprocessing_stats(), and update_best_all().

Here is the call graph for this function:

◆ maxEdgeStretchInChannel()

double maxEdgeStretchInChannel ( int  i)
Returns
the total stretch of edges in channel i; assumes the positions of nodes on the two layers have been updated correctly

Definition at line 95 of file channel.c.

References channel_struct::number_of_edges, and stretch().

Referenced by maxEdgeStretch().

Here is the call graph for this function:

◆ maxStretchEdge()

Edgeptr maxStretchEdge ( )
Returns
the edge with maximum stretch among edges that have not been fixed

Definition at line 146 of file channel.c.

References genrand_permute(), isFixedEdge(), master_edge_list, number_of_edges, randomize_order, and stretch().

Referenced by maximumStretchEdge().

Here is the call graph for this function:

◆ totalChannelStretch()

double totalChannelStretch ( int  i)
Returns
the total stretch of edges in channel i; assumes the positions of nodes on the two layers have been updated correctly

Definition at line 69 of file channel.c.

References channel_struct::number_of_edges, stretch(), and total_stretch.

Referenced by totalLayerStretch(), and totalStretch().

Here is the call graph for this function:

◆ totalLayerStretch()

double totalLayerStretch ( int  i)
Returns
the total stretch of edges incident on layer i

Definition at line 80 of file channel.c.

References number_of_layers, total_stretch, and totalChannelStretch().

Referenced by sift_node_for_total_stretch().

Here is the call graph for this function:

◆ totalStretch()

double totalStretch ( )
Returns
the total stretch of all edges

Definition at line 109 of file channel.c.

References iteration, number_of_layers, total_stretch, and totalChannelStretch().

Referenced by capture_beginning_stats(), capture_preprocessing_stats(), trace_printer(), and update_best_all().

Here is the call graph for this function:

Variable Documentation

◆ channels

Channelptr* channels

channels[i] is information about edges between layers i - 1 and i; the entry for i = 0 is not used

Definition at line 17 of file channel.c.