Graph Convolutional Branch and Bound v1.0.0
A TSP solver that combines a graph convolutional network with a 1-Tree branch-and-bound.
Loading...
Searching...
No Matches
Functions
list_functions.c File Reference

The definition of the functions to manipulate the List. More...

#include "list_functions.h"

Go to the source code of this file.

Functions

Listnew_list (void)
 Create a new instance of a List.
 
void del_list (List *list)
 Delete an instance of a List.
 
DllElembuild_dll_elem (void *value, DllElem *next, DllElem *prev)
 
bool is_list_empty (List *list)
 Check if the List is empty.
 
size_t get_list_size (List *list)
 Gets the size of the List.
 
void add_elem_list_bottom (List *list, void *element)
 Adds an DllElem to the bottom of the List.
 
void add_elem_list_index (List *list, void *element, size_t index)
 Adds an DllElem at the index indicated of the List.
 
void delete_list_elem_bottom (List *list)
 Deletes the DllElem at the bottom of the List.
 
void delete_list_elem_index (List *list, size_t index)
 Deletes the DllElem at the indicated index of the List.
 
void * get_list_elem_index (List *list, size_t index)
 Retrieves a pointer to an DllElem from the List.
 

Detailed Description

The definition of the functions to manipulate the List.

Authors
Lorenzo Sciandra, Stefano Vittorio Porta and Ivan Spada

This is a double linked List implementation that we have realized for an university project.

Version
1.0.0
Date
2019-07-9

Repo: https://gitlab.com/Stefa168/laboratorio-algoritmi-2018-19/

Definition in file list_functions.c.

Function Documentation

◆ add_elem_list_bottom()

void add_elem_list_bottom ( List list,
void *  element 
)

Adds an DllElem to the bottom of the List.

Parameters
listThe List to add the DllElem to.
elementThe DllElem to add.

Definition at line 66 of file list_functions.c.

◆ add_elem_list_index()

void add_elem_list_index ( List array,
void *  element,
size_t  index 
)

Adds an DllElem at the index indicated of the List.

Parameters
arrayThe List to add the DllElem to.
elementThe DllElem to add.
indexAt what index to add the DllElem to the List.

list is clearer way but it is already checked inside get_list_size

Definition at line 86 of file list_functions.c.

◆ build_dll_elem()

DllElem * build_dll_elem ( void *  value,
DllElem next,
DllElem prev 
)

Definition at line 46 of file list_functions.c.

◆ del_list()

void del_list ( List list)

Delete an instance of a List.

This method deallocates only the data structure, NOT the data contained.

Parameters
listThe List to delete.

Definition at line 28 of file list_functions.c.

◆ delete_list_elem_bottom()

void delete_list_elem_bottom ( List list)

Deletes the DllElem at the bottom of the List.

Parameters
listThe List to remove the DllElem from.

Definition at line 127 of file list_functions.c.

◆ delete_list_elem_index()

void delete_list_elem_index ( List list,
size_t  index 
)

Deletes the DllElem at the indicated index of the List.

Parameters
listThe List to remove the DllElem from.
indexThe index of the DllElem to remove from the List.

list is clearer but it is already checked inside get_list_size

Definition at line 147 of file list_functions.c.

◆ get_list_elem_index()

void * get_list_elem_index ( List list,
size_t  index 
)

Retrieves a pointer to an DllElem from the List.

Parameters
listThe List to retrieve the DllElem from.
indexThe index of the DllElem to retrieve.
Returns
A pointer to the retrieved DllElem.

Definition at line 185 of file list_functions.c.

◆ get_list_size()

size_t get_list_size ( List list)

Gets the size of the List.

Parameters
listPointer to the List to check.
Returns
Size of the List l.

Definition at line 61 of file list_functions.c.

◆ is_list_empty()

bool is_list_empty ( List list)

Check if the List is empty.

Parameters
listPointer to the List to check.
Returns
true if empty, false otherwise.

Definition at line 56 of file list_functions.c.

◆ new_list()

List * new_list ( void  )

Create a new instance of a List.

Returns
The newly created List.

Definition at line 18 of file list_functions.c.