parquet_debug_poisson_path Subroutine

public pure subroutine parquet_debug_poisson_path(rng, lambda, k, path, squeeze_ok)

Reports which algorithm and branch a %poisson draw took. Test-only; see parquet_debug_normal_path.

path is 1 for Knuth's product, 2 for a PTRS candidate taken by the fast acceptance region and 3 for one taken by the full logarithmic test. Forcing the OTHER algorithm is not offered, and does not need to be: which one runs is decided by lambda alone, so a test reaches either by choosing a lambda on the side it wants -- and that is a better test, because it exercises the crossover as it actually ships.

Arguments

Type IntentOptional Attributes Name
type(pf_random_stream), intent(inout) :: rng

the stream to advance, as %poisson would

real(kind=real64), intent(in) :: lambda

the mean; must be >= 0 and finite

integer(kind=int64), intent(out) :: k

the count, equal to %poisson's

integer(kind=int32), intent(out) :: path

1 Knuth, 2 PTRS fast, 3 PTRS log test

logical, intent(out), optional :: squeeze_ok

.false. iff the fast region accepted a candidate the full test would reject


Source Code

    pure subroutine parquet_debug_poisson_path(rng, lambda, k, path, squeeze_ok)
        type(pf_random_stream), intent(inout) :: rng    !! the stream to advance, as `%poisson` would
        real(real64), intent(in) :: lambda              !! the mean; must be >= 0 and finite
        integer(int64), intent(out) :: k                !! the count, equal to `%poisson`'s
        integer(int32), intent(out) :: path             !! 1 Knuth, 2 PTRS fast, 3 PTRS log test
        logical, intent(out), optional :: squeeze_ok    !! `.false.` iff the fast region accepted a
                                                        !! candidate the full test would reject
        call poisson_draw(rng, lambda, k, path, squeeze_ok)
    end subroutine parquet_debug_poisson_path