GOBNILP  f164d83
Functions
vector.c File Reference

Implements a data type representing a resizable array of integers. More...

#include "vector.h"
Include dependency graph for vector.c:

Functions

void VectorAppend (Vector *vec, int item)
 Appends an item to the end of a vector. More...
 
void VectorClear (Vector *vec)
 Clears all the values from a vector. More...
 
SCIP_Bool VectorContains (Vector *vec, int item)
 Determine whether a vector contains a value. More...
 
VectorVectorCreate (int capacity)
 Creates a vector with a given capacity. More...
 
void VectorDelete (Vector **vec)
 Deallocates the memory associated with a vector. More...
 

Detailed Description

Implements a data type representing a resizable array of integers.

Function Documentation

◆ VectorAppend()

void VectorAppend ( Vector vec,
int  item 
)

Appends an item to the end of a vector.

Parameters
vecThe vector to extend.
itemThe item to add.

References Vector::items, and Vector::size.

Referenced by circuit(), and findStronglyConnectedComponents().

◆ VectorClear()

void VectorClear ( Vector vec)

Clears all the values from a vector.

Parameters
vecThe vector to clear.

References Vector::size.

Referenced by CC_findCuts(), and unblock().

◆ VectorContains()

SCIP_Bool VectorContains ( Vector vec,
int  item 
)

Determine whether a vector contains a value.

Parameters
vecThe vector to search.
itemThe item to search for.
Returns
Whether the item was in the vector.

References Vector::items, and Vector::size.

Referenced by circuit(), and shouldIncludeInCuts().

◆ VectorCreate()

Vector* VectorCreate ( int  capacity)

Creates a vector with a given capacity.

Parameters
capacityThe maximum capacity of the vector.
Returns
An empty vector.

References Vector::capacity, Vector::items, and Vector::size.

Referenced by circuit(), findStronglyConnectedComponents(), and PS_splitToComponents().

◆ VectorDelete()

void VectorDelete ( Vector **  vec)

Deallocates the memory associated with a vector.

Parameters
vecThe vector to free.

Referenced by CC_finalise(), findStronglyConnectedComponents(), PS_splitToComponents(), VectorListClear(), and VectorListDelete().