def evaluate_ops(prim_len: int, sec_len: int,
                 sparse_rounds: int = -1) -> float:
    """
    Evaluates the number of total node pair flow computations needed to calculate the complete
    flow in the sample according to the general_flow policy.

    :param prim_len: length of the primary set
    :param sec_len: length of the secondary set
    :param sparse_rounds: sparse rounds.
    :return:
    """

    if sparse_rounds < 1:

        if sec_len == 0:
            return prim_len**2 / 2

        else:
            return prim_len * sec_len

    else:

        if sec_len == 0:
            return prim_len * sparse_rounds // 2

        elif sec_len == 1:
            return prim_len

        else:
            return prim_len * sparse_rounds