first work on edgelists

This commit is contained in:
tTh
2023-03-26 12:44:34 +02:00
parent 39b123c641
commit 83085d1435
4 changed files with 143 additions and 6 deletions

41
tbb.c
View File

@@ -8,7 +8,38 @@
#include <stdlib.h>
#include "bubulles.h"
#include "edges.h"
/* --------------------------------------------------------------------- */
int essai_des_edges(int k)
{
EdgeList * list;
int foo, idx;
list = alloc_edgelist("oups?", k, 0);
fprintf(stderr, " alloc edge list -> %p\n", list);
print_edgelist_desc(list, 0);
foo = push_an_edge(list, 13, 37);
fprintf(stderr, " push edge -> %d\n", foo);
foo = push_an_edge(list, 24, 36);
foo = print_the_edges(list, 0);
for (idx=0; idx<10; idx++) {
foo = push_an_edge(list, idx*7, -idx);
}
foo = print_the_edges(list, 0);
foo = free_edgelist(list, 0);
fprintf(stderr, " free list -> %d\n", foo);
return -1;
}
/* --------------------------------------------------------------------- */
void test_alloc_free(int nbelm)
{
@@ -109,16 +140,20 @@ int main(int argc, char *argv[])
{
int foo;
printf("*** Bubulles Testing -- %s %s\n\n", __DATE__, __TIME__);
fprintf(stderr, "*** Bubulles Testing %s %s\n\n", __DATE__, __TIME__);
bubulles_version(1);
bubulles_version(0);
#if (0)
test_alloc_free(5);
test_push_pop(20000);
test_cleanfill_my_bublist(999);
foo = test_peek_poke(5000);
fprintf(stderr, "test peek/poke -> %d\n", foo);
#endif
foo = essai_des_edges(10);
fprintf(stderr, "test des edges -> %d\n", foo);
return 0;
}