def _check_inputs(max_steps, inner, outer):
    """Checks whether max_steps, inner and outer are okay.
    Can be run before loading matrix into memory."""

    if max_steps < 1:
        raise ValueError('maxsteps must be a positive integer')

    if inner is None:
        if outer is not None:
            raise ValueError('If inner is None, outer must be None')

    elif outer is None:
        outer = inner

    elif outer < inner:
        raise ValueError('outer must exceed or be equal to inner')

    return inner, outer