Crossings Minimization  1.0
stats.h File Reference

Functions for reporting various statistics about the graph and the outcomes. More...

#include <stdio.h>
#include <stdbool.h>
#include "order.h"
Include dependency graph for stats.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  crossing_stats_int
 
struct  crossing_stats_double
 

Typedefs

typedef struct crossing_stats_int CROSSING_STATS_INT
 
typedef struct crossing_stats_double CROSSING_STATS_DOUBLE
 

Functions

void init_crossing_stats (void)
 
void capture_beginning_stats (void)
 
void capture_preprocessing_stats (void)
 
void capture_heuristic_stats (void)
 
void capture_post_processing_stats (void)
 
void update_best_int (CROSSING_STATS_INT *stats, Orderptr order, int(*crossing_retrieval_function)(void))
 
void update_best_double (CROSSING_STATS_DOUBLE *stats, Orderptr order, double(*crossing_retrieval_function)(void))
 
void update_best_all (void)
 
bool has_improved_int (CROSSING_STATS_INT *stats)
 
bool has_improved_double (CROSSING_STATS_DOUBLE *stats)
 
void print_graph_statistics (FILE *output_stream)
 
void print_run_statistics (FILE *output_stream)
 

Variables

CROSSING_STATS_INT total_crossings
 
CROSSING_STATS_INT max_edge_crossings
 
CROSSING_STATS_INT favored_edge_crossings
 
CROSSING_STATS_DOUBLE total_stretch
 
CROSSING_STATS_DOUBLE bottleneck_stretch
 

Detailed Description

Functions for reporting various statistics about the graph and the outcomes.

Author
Matthias Stallmann
Date
2009/05/19
Id
stats.h 12 2011-06-17 22:00:01Z mfms

Definition in file stats.h.

Typedef Documentation

◆ CROSSING_STATS_DOUBLE

◆ CROSSING_STATS_INT

Function Documentation

◆ capture_beginning_stats()

void capture_beginning_stats ( void  )

Saves statistics about crossings before run for later printing

Definition at line 195 of file stats.c.

References crossing_stats_int::at_beginning, crossing_stats_double::at_beginning, maxEdgeCrossings(), maxEdgeStretch(), numberOfCrossings(), priorityEdgeCrossings(), and totalStretch().

Referenced by main().

Here is the call graph for this function:

◆ capture_heuristic_stats()

void capture_heuristic_stats ( void  )

Saves statistics about crossings after the main heuristic has completed for later printing Assumes that the best heuristic iteration has already been saved and the best heuristic ordering has been restored.

Definition at line 217 of file stats.c.

References crossing_stats_int::after_heuristic, crossing_stats_double::after_heuristic, crossing_stats_int::best, and crossing_stats_double::best.

Referenced by main().

◆ capture_post_processing_stats()

void capture_post_processing_stats ( void  )

◆ capture_preprocessing_stats()

void capture_preprocessing_stats ( void  )

Saves statistics about crossings after preprocessing for later printing

Definition at line 206 of file stats.c.

References crossing_stats_int::after_preprocessing, crossing_stats_double::after_preprocessing, maxEdgeCrossings(), maxEdgeStretch(), numberOfCrossings(), priorityEdgeCrossings(), and totalStretch().

Referenced by main().

Here is the call graph for this function:

◆ has_improved_double()

bool has_improved_double ( CROSSING_STATS_DOUBLE stats)
Returns
true if stats.best has improved since the last time this function was called

Side effect</e> stats.previous_best is updated

Definition at line 327 of file stats.c.

References crossing_stats_double::best, pareto_item::iteration, crossing_stats_double::name, and crossing_stats_double::previous_best.

Referenced by no_improvement().

◆ has_improved_int()

bool has_improved_int ( CROSSING_STATS_INT stats)
Returns
true if stats.best has improved since the last time this function was called

Side effect</e> stats.previous_best is updated

Definition at line 309 of file stats.c.

References crossing_stats_int::best, pareto_item::iteration, crossing_stats_int::name, and crossing_stats_int::previous_best.

Referenced by no_improvement().

◆ init_crossing_stats()

void init_crossing_stats ( void  )

Initializes crossing stats structures

Definition at line 182 of file stats.c.

References init_pareto_list(), init_specific_crossing_stats_double(), init_specific_crossing_stats_int(), NO_PARETO, and pareto_objective.

Referenced by main().

Here is the call graph for this function:

◆ print_graph_statistics()

void print_graph_statistics ( FILE *  output_stream)

Print statistics that are intrinsic to the graph, independent of any heuristics

Todo:
minimize maximum crossings on any layer

Definition at line 485 of file stats.c.

References compute_degree_statistics(), free_statistics(), get_max(), get_mean(), get_median(), get_min(), graph_name, init_statistics(), number_of_edges, number_of_isolated_nodes, number_of_layers, number_of_nodes, print_channel_degree_statistics(), print_channel_edge_counts(), print_degree_statistics(), and verbose.

Referenced by main().

Here is the call graph for this function:

◆ print_run_statistics()

void print_run_statistics ( FILE *  output_stream)

Print statistics that document the results of the heuristic just completed

Definition at line 532 of file stats.c.

References heuristic, pareto_item::iteration, NO_PARETO, pareto_objective, preprocessor, print_crossing_stats_double(), print_crossing_stats_int(), print_pareto_list(), and RUNTIME.

Referenced by main().

Here is the call graph for this function:

◆ update_best_all()

void update_best_all ( void  )

◆ update_best_double()

void update_best_double ( CROSSING_STATS_DOUBLE stats,
Orderptr  order,
double(*)(void)  crossing_retrieval_function 
)

Updates the best value if needed, usually at the end of an iteration

Parameters
statsthe stats struct to be updated
orderthe order that needs to be captured when the best is updated
crossing_retrieval_functionfunction that returns the current value – to be compared to the best value

Definition at line 263 of file stats.c.

References crossing_stats_double::best, crossing_stats_double::best_heuristic_iteration, pareto_item::iteration, crossing_stats_double::name, and save_order().

Referenced by update_best_all().

Here is the call graph for this function:

◆ update_best_int()

void update_best_int ( CROSSING_STATS_INT stats,
Orderptr  order,
int(*)(void)  crossing_retrieval_function 
)

Updates the best value if needed, usually at the end of an iteration

Parameters
statsthe stats struct to be updated
orderthe order that needs to be captured when the best is updated
crossing_retrieval_functionfunction that returns the current value – to be compared to the best value

Definition at line 245 of file stats.c.

References crossing_stats_int::best, crossing_stats_int::best_heuristic_iteration, pareto_item::iteration, crossing_stats_int::name, and save_order().

Referenced by update_best_all().

Here is the call graph for this function:

Variable Documentation

◆ bottleneck_stretch

CROSSING_STATS_DOUBLE bottleneck_stretch

Definition at line 151 of file stats.c.

Referenced by no_improvement().

◆ favored_edge_crossings

CROSSING_STATS_INT favored_edge_crossings

Definition at line 149 of file stats.c.

Referenced by no_improvement().

◆ max_edge_crossings

CROSSING_STATS_INT max_edge_crossings

◆ total_crossings

◆ total_stretch