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

Defines the structure and comparison function for nanowire junctions. More...

#include "util/point.h"

Go to the source code of this file.

Classes

struct  junction
 Stores the index of the wires forming the junction together with its position. More...
 

Functions

int jcmp (const void *e1, const void *e2)
 Compares two junctions according to their first and potentially second nanowire-index. Intended to be used with the qsort function. More...
 

Detailed Description

Defines the structure and comparison function for nanowire junctions.

This file defines a junction struct and provides a comparison function jcmp to compare two junctions based on the indices of the wires forming the junction. This allows sorting junctions by the first and second wire index.

Function Documentation

◆ jcmp()

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

Compares two junctions according to their first and potentially second nanowire-index. Intended to be used with the qsort function.

Parameters
[in]e1Pointer to the first element to compare.
[in]e2Pointer to the second element to compare.
Returns
0 if the junctions have the same first and second index; < 0 if e1 has lower first index (or in case of equality lower second index) than e2;

0 otherwise.