Skip to content

Commit db47b75

Browse files
james-d-mitchellwilfwilson
authored andcommitted
homos: fix issue 222
1 parent 5b8632b commit db47b75

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/homos.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,6 @@ static ALWAYS_INLINE uint16_t
674674
uint16_t const vertex) {
675675
push_conditions(
676676
CONDITIONS, depth, vertex, GRAPH2->neighbours[MAP[last_defined]]);
677-
set_bit_array(get_conditions(CONDITIONS, vertex), MAP[last_defined], false);
678677
store_size_conditions(CONDITIONS, vertex);
679678
return size_conditions(CONDITIONS, vertex);
680679
}
@@ -758,6 +757,7 @@ static void find_graph_monos(uint16_t depth,
758757
copy_bit_array(
759758
possible, get_conditions(CONDITIONS, next), GRAPH2->nr_vertices);
760759
intersect_bit_arrays(possible, REPS[rep_depth], GRAPH2->nr_vertices);
760+
complement_bit_arrays(possible, VALS, GRAPH2->nr_vertices);
761761
FOR_SET_BITS(possible, GRAPH2->nr_vertices, i) {
762762
MAP[next] = i;
763763
set_bit_array(VALS, i, true);
@@ -1201,7 +1201,6 @@ static ALWAYS_INLINE uint16_t
12011201
uint16_t const last_defined,
12021202
uint16_t const vertex) {
12031203
push_conditions(CONDITIONS, depth, vertex, NULL);
1204-
set_bit_array(get_conditions(CONDITIONS, vertex), MAP[last_defined], false);
12051204
if (is_adjacent_digraph(DIGRAPH1, last_defined, vertex)) {
12061205
intersect_bit_arrays(get_conditions(CONDITIONS, vertex),
12071206
DIGRAPH2->out_neighbours[MAP[last_defined]],
@@ -1283,6 +1282,7 @@ static void find_digraph_monos(uint16_t depth,
12831282
copy_bit_array(
12841283
possible, get_conditions(CONDITIONS, next), DIGRAPH2->nr_vertices);
12851284
intersect_bit_arrays(possible, REPS[rep_depth], DIGRAPH2->nr_vertices);
1285+
complement_bit_arrays(possible, VALS, DIGRAPH2->nr_vertices);
12861286
FOR_SET_BITS(possible, DIGRAPH2->nr_vertices, i) {
12871287
MAP[next] = i;
12881288
set_bit_array(VALS, i, true);

tst/standard/grahom.tst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,6 +2101,14 @@ gap> HomomorphismDigraphsFinder(D1, D2, fail, [], 1,
21012101
> fail, 2, [1, 2, 3], fail, fail, fail);
21022102
[ ]
21032103

2104+
# Issue 222
2105+
gap> D1 := DigraphFromGraph6String("E}hO");
2106+
<digraph with 6 vertices, 18 edges>
2107+
gap> D2 := DigraphFromGraph6String("E}h_");
2108+
<digraph with 6 vertices, 18 edges>
2109+
gap> mono := MonomorphismsDigraphs(D1, D2);
2110+
[ ]
2111+
21042112
# DIGRAPHS_UnbindVariables
21052113
gap> Unbind(edges);
21062114
gap> Unbind(epis);

0 commit comments

Comments
 (0)