2022-09-28 12:42:44 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "struct.h"
|
|
|
|
|
|
|
|
#ifndef DEF_UTILS_H
|
|
|
|
#define DEF_UTILS_H
|
|
|
|
|
2022-12-07 10:44:28 +01:00
|
|
|
/*
|
|
|
|
* Échange deux éléments d'un tableau
|
|
|
|
*/
|
|
|
|
void swap(int* tab, int i, int j);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Mélange un tableau avec le mélange de Knuth
|
|
|
|
*/
|
|
|
|
void knuth_shuffle(int* tab, int n);
|
|
|
|
|
2022-09-28 12:42:44 +02:00
|
|
|
/*
|
|
|
|
* Vérifie si deux réseaux sont égaux
|
|
|
|
*/
|
|
|
|
bool equals_networks(Network* network1, Network* network2);
|
|
|
|
|
2022-10-05 11:20:26 +02:00
|
|
|
/*
|
|
|
|
* Duplique un réseau
|
|
|
|
*/
|
|
|
|
Network* copy_network(Network* network);
|
|
|
|
|
2022-09-28 12:42:44 +02:00
|
|
|
#endif
|