nns.c
1.0.1
Nanowire Network simulator
|
Defines the structures and functions used to model and simulate the topology and electrical state of a Nanowire Network. More...
Go to the source code of this file.
Classes | |
struct | network_topology |
Topology of the Nanowire Network. It contains information about the physical placement of nanowires and junctions in the package. More... | |
struct | network_state |
Electrical state of the Nanowire Network. It contains the varying values of the junctions and the voltage distribution in the network nanowires. More... | |
Functions | |
network_topology | create_network (const datasheet ds, int n2c[], int *ccs_count) |
Create the Nanowire Network topology determining the wires and junctions distribution. The function produces a network topology whose nanowires and junctions are sorted according to their parent connected component. Also returns the mapping between nodes index and parent connected component index. More... | |
network_state | construe_circuit (const datasheet ds, const network_topology nt) |
Construe the equivalent electrical circuit of the Nanowire Network. Both nanowires and junctions are ordered according to their parent connected component. More... | |
int | ntcmp (const void *e1, const void *e2) |
Compare two network topologies according to the number of junctions. More... | |
network_topology | copy_topology (const datasheet ds, const network_topology nt) |
Create a deep copy of a network topology. More... | |
network_state | copy_state (const datasheet ds, const network_topology nt, const network_state ns) |
Create a deep copy of a network state. More... | |
void | destroy_topology (network_topology nt) |
Destroy a network topology memorized in the stack. This function practically frees the wires and junctions arrays of the network topology. The arrays to be freed must have been allocated in the heap with malloc/calloc. More... | |
void | destroy_state (network_state ns) |
Destroy a network state memorized in the stack. This function practically frees Ys and Vs arrays of the network state. The arrays to be freed must have been allocated in the heap with malloc/calloc. More... | |
Defines the structures and functions used to model and simulate the topology and electrical state of a Nanowire Network.
This file contains the necessary data structures and function declarations to represent a Nanowire Network, including the physical layout of nanowires and junctions, and the electrical properties such as voltage distribution and admittances. It also provides utilities for creating, copying, comparing, and destroying network topologies and states.
network_state construe_circuit | ( | const datasheet | ds, |
const network_topology | nt | ||
) |
Construe the equivalent electrical circuit of the Nanowire Network. Both nanowires and junctions are ordered according to their parent connected component.
[in] | ds | The datasheet describing the Nanowire Network. |
[in] | nt | The topology of the Nanowire Network. |
network_state copy_state | ( | const datasheet | ds, |
const network_topology | nt, | ||
const network_state | ns | ||
) |
Create a deep copy of a network state.
[in] | ds | The datasheet describing the network. |
[in] | nt | The topology of the network. |
[in] | ns | The network state to copy. |
network_topology copy_topology | ( | const datasheet | ds, |
const network_topology | nt | ||
) |
Create a deep copy of a network topology.
[in] | ds | The datasheet describing the network. |
[in] | nt | The network topology to copy. |
network_topology create_network | ( | const datasheet | ds, |
int | n2c[], | ||
int * | ccs_count | ||
) |
Create the Nanowire Network topology determining the wires and junctions distribution. The function produces a network topology whose nanowires and junctions are sorted according to their parent connected component. Also returns the mapping between nodes index and parent connected component index.
[in] | ds | The datasheet describing the Nanowire Network to realize. |
[out] | n2c | The output mapping between nodes index and parent connected component index. |
[out] | ccs_count | The number of connected components discovered. |
void destroy_state | ( | network_state | ns | ) |
Destroy a network state memorized in the stack. This function practically frees Ys and Vs arrays of the network state. The arrays to be freed must have been allocated in the heap with malloc/calloc.
[in,out] | ns | The network state to destroy. |
void destroy_topology | ( | network_topology | nt | ) |
Destroy a network topology memorized in the stack. This function practically frees the wires and junctions arrays of the network topology. The arrays to be freed must have been allocated in the heap with malloc/calloc.
[in,out] | nt | The network topology to destroy. |
int ntcmp | ( | const void * | e1, |
const void * | e2 | ||
) |
Compare two network topologies according to the number of junctions.
[in] | e1 | Pointer to the first element to compare. |
[in] | e2 | Pointer to the second element to compare. |