Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ BEGIN
return_receptor_id [6] = receptor_id + (radius + t) * number_of_hexagons_in_a_row + floor((radius - t) / 2.0);

FOR i IN 1..6 LOOP
IF (return_receptor_id[i] >= 0 AND return_receptor_id[i] <= receptor_id_max) THEN
IF (return_receptor_id[i] > 0 AND return_receptor_id[i] <= receptor_id_max) THEN
IF (i = 1) THEN IF (ceil(t / 2.0) < from_left) THEN RETURN NEXT return_receptor_id[i]; END IF;
ELSIF (i = 2) THEN IF (ceil(radius / 2.0) < from_left) THEN RETURN NEXT return_receptor_id[i]; END IF;
ELSIF (i = 3) THEN IF (ceil((radius - t) / 2.0) < from_left) THEN RETURN NEXT return_receptor_id[i]; END IF;
Expand All @@ -278,7 +278,7 @@ BEGIN
return_receptor_id [6] = receptor_id + (radius + t) * number_of_hexagons_in_a_row + ceil((radius - t) / 2.0);

FOR i IN 1..6 LOOP
IF (return_receptor_id[i] >= 0 AND return_receptor_id[i] <= receptor_id_max) THEN
IF (return_receptor_id[i] > 0 AND return_receptor_id[i] <= receptor_id_max) THEN
IF (i = 1) THEN IF (floor(t / 2.0) < from_left) THEN RETURN NEXT return_receptor_id[i]; END IF;
ELSIF (i = 2) THEN IF (floor(radius / 2.0) < from_left) THEN RETURN NEXT return_receptor_id[i]; END IF;
ELSIF (i = 3) THEN IF (floor((radius - t) / 2.0) < from_left) THEN RETURN NEXT return_receptor_id[i]; END IF;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ BEGIN
-- Because the set in tmp_calculated_receptor_ids is an ordered and distinct set of integers, the following holds: id(x+n) >= id(x) + n.
-- Furthermore when there are no "holes" in the set, the following holds: id(x+n) = id(x) + n. So we only need the first and last id in the set
-- and the number of id's.
PERFORM system.assert_equals(first_vertically_projected + number_of_distinct_rows - 1, last_vertically_projected, 'failed at receptor ' || receptor_id);
PERFORM system.assert_equals(first_vertically_projected + number_of_distinct_rows - 1, last_vertically_projected, 'failed at receptor ' || receptor_id || ', radius ' || radius);

DROP TABLE tmp_calculated_receptor_ids;

Expand Down