'For a vertical morphism, checks whether there is free space
(i.e., space not occupied by any objects) to the left of the
morphism or to the right of it.'

@staticmethod
def _check_free_space_vertical(dom_i, cod_i, dom_j, grid):

    if (dom_i < cod_i):
        (start, end) = (dom_i, cod_i)
        backwards = False
    else:
        (start, end) = (cod_i, dom_i)
        backwards = True
    if (dom_j == 0):
        free_left = True
    else:
        free_left = all([(not grid[(i, (dom_j - 1))]) for i in range(start, (end + 1))])
    if (dom_j == (grid.width - 1)):
        free_right = True
    else:
        free_right = all([(not grid[(i, (dom_j + 1))]) for i in range(start, (end + 1))])
    return (free_left, free_right, backwards)
