aboutsummaryrefslogtreecommitdiff
path: root/puzzles.h
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2023-04-20 14:46:46 +0100
committerSimon Tatham <anakin@pobox.com>2023-04-20 17:30:03 +0100
commit348aac4c85da21e09c29c58866d178df3204d73c (patch)
treeeff802bf3ef3b5459bbe268e35328b1155cf3472 /puzzles.h
parentdad2f35502c611dae758915cfb6dface4a303550 (diff)
downloadpuzzles-348aac4c85da21e09c29c58866d178df3204d73c.zip
puzzles-348aac4c85da21e09c29c58866d178df3204d73c.tar.gz
puzzles-348aac4c85da21e09c29c58866d178df3204d73c.tar.bz2
puzzles-348aac4c85da21e09c29c58866d178df3204d73c.tar.xz
Remove size parameter from dsf init and copy functions.
Now that the dsf knows its own size internally, there's no need to tell it again when one is copied or reinitialised. This makes dsf_init much more about *re*initialising a dsf, since now dsfs are always allocated using a function that will initialise them anyway. So I think it deserves a rename.
Diffstat (limited to 'puzzles.h')
-rw-r--r--puzzles.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/puzzles.h b/puzzles.h
index 8a949de..add58b2 100644
--- a/puzzles.h
+++ b/puzzles.h
@@ -432,7 +432,7 @@ void dsf_free(DSF *dsf);
void print_dsf(DSF *dsf, int size);
-void dsf_copy(DSF *to, DSF *from, int size);
+void dsf_copy(DSF *to, DSF *from);
/* Return the canonical element of the equivalence class containing element
* val. If 'inverse' is non-NULL, this function will put into it a flag
@@ -448,7 +448,9 @@ int dsf_size(DSF *dsf, int val);
* be both opposite and non-opposite. */
void edsf_merge(DSF *dsf, int v1, int v2, bool inverse);
void dsf_merge(DSF *dsf, int v1, int v2);
-void dsf_init(DSF *dsf, int len);
+
+/* Reinitialise a dsf to the starting 'all elements distinct' state. */
+void dsf_reinit(DSF *dsf);
/*
* tdq.c