Crossings Minimization  1.0
check_edge_duplication.h File Reference

utility that uses hashing to check whether an edge already exists More...

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

Go to the source code of this file.

Functions

void create_hash_table_for_pairs (int expected_number_of_pairs)
 
void destroy_hash_table_for_pairs (void)
 
bool pair_already_exists (int first_int, int second_int)
 

Detailed Description

utility that uses hashing to check whether an edge already exists

Id
check_edge_duplication.h 2 2011-06-07 19:50:41Z mfms

Definition in file check_edge_duplication.h.

Function Documentation

◆ create_hash_table_for_pairs()

void create_hash_table_for_pairs ( int  expected_number_of_pairs)

Allocates the hash table based on the expected number of pairs

Definition at line 68 of file check_edge_duplication.c.

References bit_vector_length, bits_per_pair, bytes_per_pair, LOAD_FACTOR, and pairs_bit_vector.

Referenced by add_edges(), and create_random_dag().

◆ destroy_hash_table_for_pairs()

void destroy_hash_table_for_pairs ( void  )

Deallocates the hash table

Definition at line 79 of file check_edge_duplication.c.

References collisions, and pairs_bit_vector.

Referenced by add_edges(), and create_random_dag().

◆ pair_already_exists()

bool pair_already_exists ( int  first_int,
int  second_int 
)
Parameters
first_intindex of a node in the master_node_list
second_intindex of another node in the master_node_list
Returns
true if an edge between the given nodes already exists This function is oblivious to the fact that we are dealing with a random dag - it applies to any collection of pairs of integers

Side effect: If the pair does not already exist, it will exist from henceforth

Parameters
first_intindex of a node in the master_node_list
second_intindex of another node in the master_node_list
Returns
true if an edge between the given nodes already exists This function is oblivious to the fact that we are dealing with a random dag - it applies to any collection of pairs of integers

Definition at line 93 of file check_edge_duplication.c.

References bit_vector_length, collisions, HASH_VALUE_ONE, HASH_VALUE_TWO, pairs_bit_vector, and polynomial_hash().

Referenced by add_edges(), create_random_dag(), and make_all_current_edges_exist().

Here is the call graph for this function: