src/sn_{network,stage}.[ch]: Implement sn_network_unify().
[sort-networks.git] / src / sn_network.h
index 328d0fe..f29c9b3 100644 (file)
@@ -31,6 +31,8 @@
 #define SN_NETWORK_H 1
 
 #include <stdio.h>
+#include <stdint.h>
+#include <inttypes.h>
 
 #include "sn_comparator.h"
 #include "sn_stage.h"
@@ -87,6 +89,15 @@ void sn_network_destroy (sn_network_t *n);
 sn_network_t *sn_network_create_odd_even_mergesort (int inputs_num);
 
 /**
+ * Creates a new sort network using Batcher's Bitonic-Mergesort algorithm.
+ *
+ * \param inputs_num Number of inputs / outputs of the sorting network.
+ * \return A pointer to the newly allocated sorting network or \c NULL if an
+ *   invalid number of inputs was given or allocation failed.
+ */
+sn_network_t *sn_network_create_bitonic_mergesort (int inputs_num);
+
+/**
  * Creates a new sorting network using the Pairwise sorting algorithm published
  * by Ian Parberry.
  * \param inputs_num Number of inputs / outputs of the sorting network.
@@ -222,6 +233,8 @@ int sn_network_compress (sn_network_t *n);
  */
 int sn_network_normalize (sn_network_t *n);
 
+int sn_network_unify (sn_network_t *n);
+
 /**
  * Removes an input and all comparators touching that input from the comparator
  * network.
@@ -342,6 +355,9 @@ int sn_network_serialize (sn_network_t *n, char **ret_buffer,
  * \see sn_network_serialize
  */
 sn_network_t *sn_network_unserialize (char *buffer, size_t buffer_size);
+
+uint32_t sn_network_get_hashval (const sn_network_t *n);
+
 #endif /* SN_NETWORK_H */
 
 /* vim: set shiftwidth=2 softtabstop=2 : */