nns.c  1.0.1
Nanowire Network simulator
wire.h File Reference

Defines the ‘wire’ structure and a function for comparing wires by length. More...

#include "util/point.h"

Go to the source code of this file.

Classes

struct  wire
 Stores the starting and ending positions of a wire together with its centroid position and total length. More...
 

Functions

int wcmp (const void *e1, const void *e2)
 Compares two nanowires according to their length. More...
 

Detailed Description

Defines the ‘wire’ structure and a function for comparing wires by length.

This file contains the definition of the wire structure, which represents a nanowire with its centroid, start / end positions, and length. It also provides a comparison function wcmp to compare two nanowires based on their lengths.

Function Documentation

◆ wcmp()

int wcmp ( const void *  e1,
const void *  e2 
)

Compares two nanowires according to their length.

Parameters
[in]e1Pointer to the first element to compare.
[in]e2Pointer to the second element to compare.
Returns
0 if the nanowires have the same length; < 0 if e1 is shorter than e2; > 0 otherwise.