From: Florian Forster Date: Thu, 20 Nov 2008 08:44:40 +0000 (+0100) Subject: src/sn_network.[ch]: Implement `sn_network_shift'. X-Git-Tag: v1.0.0~86 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=76c8993c0e5a4cab6a63d838cc3653c4e5ef82bf;p=sort-networks.git src/sn_network.[ch]: Implement `sn_network_shift'. --- diff --git a/src/sn_network.c b/src/sn_network.c index 4dfd6d7..a1ada08 100644 --- a/src/sn_network.c +++ b/src/sn_network.c @@ -175,6 +175,16 @@ int sn_network_invert (sn_network_t *n) /* {{{ */ return (0); } /* }}} int sn_network_invert */ +int sn_network_shift (sn_network_t *n, int sw) /* {{{ */ +{ + int i; + + for (i = 0; i < n->stages_num; i++) + sn_stage_shift (n->stages[i], sw, SN_NETWORK_INPUT_NUM (n)); + + return (0); +} /* }}} int sn_network_shift */ + int sn_network_compress (sn_network_t *n) /* {{{ */ { int i; diff --git a/src/sn_network.h b/src/sn_network.h index 905097d..3af9c72 100644 --- a/src/sn_network.h +++ b/src/sn_network.h @@ -51,6 +51,7 @@ 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);