private LargeMeanPoissonSampler()

in commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSampler.java [195:221]


    private LargeMeanPoissonSampler(LargeMeanPoissonSamplerState state,
                                    double lambdaFractional,
                                    UniformRandomProvider rng) {
        this.rng = rng;

        gaussian = ZigguratSampler.NormalizedGaussian.of(rng);
        exponential = ZigguratSampler.Exponential.of(rng);
        // Plain constructor uses the uncached function.
        factorialLog = NO_CACHE_FACTORIAL_LOG;

        // Use the state to initialize the algorithm
        lambda = state.getLambdaRaw();
        logLambda = state.getLogLambda();
        logLambdaFactorial = state.getLogLambdaFactorial();
        delta = state.getDelta();
        halfDelta = state.getHalfDelta();
        sqrtLambdaPlusHalfDelta = state.getSqrtLambdaPlusHalfDelta();
        twolpd = state.getTwolpd();
        p1 = state.getP1();
        p2 = state.getP2();
        c1 = state.getC1();

        // The algorithm requires a Poisson sample from the remaining lambda fraction.
        smallMeanPoissonSampler = (lambdaFractional < Double.MIN_VALUE) ?
            NO_SMALL_MEAN_POISSON_SAMPLER : // Not used.
            KempSmallMeanPoissonSampler.of(rng, lambdaFractional);
    }