mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
Introduce a new dsf_equivalent() function.
Not very interesting, but the idiom for checking equivalence via two calls to dsf_canonify is cumbersome enough to be worth abbreviating.
This commit is contained in:
@ -439,6 +439,11 @@ int edsf_canonify(DSF *dsf, int val, bool *inverse);
|
||||
int dsf_canonify(DSF *dsf, int val);
|
||||
int dsf_size(DSF *dsf, int val);
|
||||
|
||||
/* Check whether two elements are in the same equivalence class.
|
||||
* Equivalent to, but less verbose than, calling dsf_canonify twice
|
||||
* and seeing if their two canonical elements are the same. */
|
||||
bool dsf_equivalent(DSF *dsf, int v1, int v2);
|
||||
|
||||
/* Allow the caller to specify that two elements should be in the same
|
||||
* equivalence class. If 'inverse' is true, the elements are actually opposite
|
||||
* to one another in some sense. This function will fail an assertion if the
|
||||
|
Reference in New Issue
Block a user