X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fsn_network.h;h=ac5556508508d19796baab7a34f1a10409780f3a;hb=8764b3122abba9e60cacb591f16a5e71abb5155f;hp=35c20631268f48a7286b0ecc4974d3ccf87164c9;hpb=7f10c476bf916bb9e896526d669b3f3dd8022d4c;p=sort-networks.git diff --git a/src/sn_network.h b/src/sn_network.h index 35c2063..ac55565 100644 --- a/src/sn_network.h +++ b/src/sn_network.h @@ -1,3 +1,24 @@ +/** + * libsortnetwork - src/sn_network.h + * Copyright (C) 2008-2010 Florian octo Forster + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; only version 2 of the License is applicable. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Authors: + * Florian octo Forster + **/ + #ifndef SN_NETWORK_H #define SN_NETWORK_H 1 @@ -22,22 +43,38 @@ sn_network_t *sn_network_create (int inputs_num); sn_network_t *sn_network_clone (const sn_network_t *n); void sn_network_destroy (sn_network_t *n); +sn_network_t *sn_network_create_odd_even_mergesort (int inputs_num); + int sn_network_stage_add (sn_network_t *n, sn_stage_t *s); int sn_network_stage_remove (sn_network_t *n, int s_num); +int sn_network_comparator_add (sn_network_t *n, const sn_comparator_t *c); + +int sn_network_get_comparator_num (const sn_network_t *n); + +int sn_network_sort (sn_network_t *n, int *values); +int sn_network_brute_force_check (sn_network_t *n); + int sn_network_show (sn_network_t *n); int sn_network_invert (sn_network_t *n); +int sn_network_shift (sn_network_t *n, int s); int sn_network_compress (sn_network_t *n); int sn_network_normalize (sn_network_t *n); int sn_network_cut_at (sn_network_t *n, int input, enum sn_network_cut_dir_e dir); -sn_network_t *sn_network_combine (sn_network_t *n0, sn_network_t *n1); +sn_network_t *sn_network_combine (sn_network_t *n0, sn_network_t *n1, + int is_power_of_two); +sn_network_t *sn_network_combine_bitonic (sn_network_t *n0, sn_network_t *n1); +sn_network_t *sn_network_combine_odd_even_merge (sn_network_t *n0, sn_network_t *n1); sn_network_t *sn_network_read (FILE *fh); sn_network_t *sn_network_read_file (const char *file); int sn_network_write (sn_network_t *n, FILE *fh); int sn_network_write_file (sn_network_t *n, const char *file); +int sn_network_serialize (sn_network_t *n, char **ret_buffer, + size_t *ret_buffer_size); +sn_network_t *sn_network_unserialize (char *buffer, size_t buffer_size); #endif /* SN_NETWORK_H */ /* vim: set shiftwidth=2 softtabstop=2 : */