CoinAdjacencyVector

A class to store a (growable) list of neighbors for each node in a conflict graph.

A class to store a (growable) list of neighbors for each node in a conflict graph.

Public Methods

CoinAdjacencyVector

Default constructor.

 CoinAdjacencyVector(size_t _nRows, size_t _iniRowSize)

Parameters:

getRow

Return the contents of a given row.

const size_t * getRow(size_t idxRow)

Parameters:

rowSize

Return the size of a given row.

size_t rowSize(size_t idxRow)

Parameters:

isNeighbor

Check if a node is included as neighbor of another node.

bool isNeighbor(size_t idxNode, size_t idxNeigh)

Parameters:

addNeighbor

Add a new neighbor to a node.

void addNeighbor(size_t idxNode, size_t idxNeigh, bool addReverse = false)

Parameters:

fastAddNeighbor

Add a new neighbor to a node without checking for repeated entries or sorting.

void fastAddNeighbor(size_t idxNode, size_t idxNeigh)

Parameters:

addNeighborsBuffer

Add elements without checking for repeated entries or sorting later.

void addNeighborsBuffer(size_t idxNode, size_t n, const size_t elements)

Parameters:

sort

Sort all neighbors of all elements.

void sort()

flush

Sort all neighbors of all elements and remove duplicates.

void flush()

sort

Sort all neighbors of idxRow.

void sort(size_t idxRow)

Parameters:

~CoinAdjacencyVector

Destructor.

 ~CoinAdjacencyVector()

totalElements

Return the total number of elements.

size_t totalElements()

tryAddElementSortedVector

Try to add an element to a sorted vector, keeping it sorted.

bool tryAddElementSortedVector(std::vector< size_t > & el, size_t newEl)

Parameters:

Source

Header: layer-0/CoinUtils/src/CoinAdjacencyVector.hpp