From: Florian Forster Date: Thu, 20 Nov 2008 08:43:29 +0000 (+0100) Subject: src/sn_stage.[ch]: Implement `sn_stage_shift'. X-Git-Tag: v1.0.0~87 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=05506d0d82f83add46b22f65b455b87ac5ca7745;p=sort-networks.git src/sn_stage.[ch]: Implement `sn_stage_shift'. --- diff --git a/src/sn_stage.c b/src/sn_stage.c index 3999851..5799b7c 100644 --- a/src/sn_stage.c +++ b/src/sn_stage.c @@ -282,6 +282,16 @@ int sn_stage_invert (sn_stage_t *s) return (0); } /* int sn_stage_invert */ +int sn_stage_shift (sn_stage_t *s, int sw, int inputs_num) +{ + int i; + + for (i = 0; i < s->comparators_num; i++) + sn_comparator_shift (s->comparators + i, sw, inputs_num); + + return (0); +} /* int sn_stage_shift */ + int sn_stage_swap (sn_stage_t *s, int con0, int con1) { int i; diff --git a/src/sn_stage.h b/src/sn_stage.h index e625de6..295e296 100644 --- a/src/sn_stage.h +++ b/src/sn_stage.h @@ -56,6 +56,7 @@ int sn_stage_comparator_check_conflict (sn_stage_t *s, const sn_comparator_t *c) int sn_stage_show (sn_stage_t *s); int sn_stage_invert (sn_stage_t *s); +int sn_stage_shift (sn_stage_t *s, int sw, int inputs_num); 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); int sn_stage_remove_input (sn_stage_t *s, int input);