def _right_zero_blocks(self, r):
    """Number of blocks with zeros from the right in block row `r`."""
    if not self._include_off_diagonal:
      return self._block_rows - r - 1
    elif self._upper:
      return 0
    elif self._include_diagonal:
      return self._block_rows - r - 1
    else:
      return self._block_rows - r