def _get_start_end_row(A, nrows):
    """Find the starting and ending points of the matrix"""
    istart = None
    for irow in range(nrows):
        if abs(A[irow]) > 0.0:
            istart = irow
            break
    iend = None
    for irow in reversed(range(nrows)):
        if abs(A[irow]) > 0.0:
            iend = irow
            break
    return istart, iend
