nns.c
1.0.1
Nanowire Network simulator
|
Defines the structure and operations for connected components in a Nanowire Network. More...
Go to the source code of this file.
Classes | |
struct | connected_component |
Connected component of the Nanowire Network. It contains all the information needed to identify the nanowires and junctions in it. Additionally, it contains the index of the junctions in the CC-specific adjacency matrix. More... | |
Functions | |
int | cccmp (const void *e1, const void *e2) |
Compare two connected components according to their size and potentially the number of junctions. More... | |
connected_component | copy_component (const connected_component cc) |
Create a deep copy of a connected component. More... | |
void | destroy_component (connected_component cc) |
Destroy a connected component by freeing its pointers (i.e., Is). The array to be freed must have been allocated in the heap. More... | |
Defines the structure and operations for connected components in a Nanowire Network.
This file contains the definition of the connected_component
struct, which represents a connected component of the Nanowire Network and identify its belonging nanowires and junctions. Additionally, it provides functions to compare, copy, and destroy connected components.
connected_component
uses dynamically allocated memory that must be managed using the provided functions. int cccmp | ( | const void * | e1, |
const void * | e2 | ||
) |
Compare two connected components according to their size and potentially the number of junctions.
[in] | e1 | Pointer to the first element to compare. |
[in] | e2 | Pointer to the second element to compare. |
connected_component copy_component | ( | const connected_component | cc | ) |
Create a deep copy of a connected component.
[in] | cc | The connected component to copy. |
void destroy_component | ( | connected_component | cc | ) |
Destroy a connected component by freeing its pointers (i.e., Is). The array to be freed must have been allocated in the heap.
[in,out] | cc | The connected component to destroy. |