X-Git-Url: https://git.octo.it/?p=sort-networks.git;a=blobdiff_plain;f=src%2Fsn_stage.h;h=2f5f7298bbf720d69b3e0b98ed01612e5a5d47ed;hp=d9475152fd537afed61af2471c6e878bfd1438a1;hb=785cb745f68b61aa83820a4f85a8c91a0e015228;hpb=93e893f5828b7c7c9639ba730f689cd6ff550f5e diff --git a/src/sn_stage.h b/src/sn_stage.h index d947515..2f5f729 100644 --- a/src/sn_stage.h +++ b/src/sn_stage.h @@ -6,18 +6,19 @@ * libsortnetwork - src/sn_stage.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 library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * 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. + * This library 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 Lesser 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 + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Authors: * Florian octo Forster @@ -28,6 +29,8 @@ #define SN_STAGE_H 1 #include +#include +#include #include "sn_comparator.h" @@ -163,6 +166,8 @@ int sn_stage_invert (sn_stage_t *s); */ int sn_stage_shift (sn_stage_t *s, int sw, int inputs_num); +int sn_stage_unify (sn_stage_t *s); + /** * Swaps two lines. This is used by the algorithm used in * sn_network_normalize() to transform non-standard sort networks to standard @@ -191,6 +196,9 @@ int sn_stage_swap (sn_stage_t *s, int con0, int con1); */ int sn_stage_cut_at (sn_stage_t *s, int input, enum sn_network_cut_dir_e dir); +/* FIXME: Documentation */ +int sn_stage_cut (sn_stage_t *s, int *mask, sn_stage_t **prev); + /** * Remove an input from a stage, remove all touching comparators and adapt the * input indexes of all remaining comparators. @@ -246,6 +254,10 @@ int sn_stage_serialize (sn_stage_t *s, */ sn_stage_t *sn_stage_unserialize (char **buffer, size_t *buffer_size); +int sn_stage_compare (const sn_stage_t *s0, const sn_stage_t *s1); + +uint64_t sn_stage_get_hashval (const sn_stage_t *s); + #endif /* SN_STAGE_H */ /* vim: set shiftwidth=2 softtabstop=2 : */