constrained_sample_3D_fast Subroutine

private subroutine constrained_sample_3D_fast(this, i, j, k, contain, contain_ilut, renormalization, pos, tgt, prob)

Draw a random element from 1:size(this%probs) with the probabilities listed in prob while adherring to constraints

Type Bound

AliasSampler_3D_t

Arguments

Type IntentOptional Attributes Name
class(AliasSampler_3D_t), intent(in) :: this
integer, intent(in) :: i

The index of the sampler.

integer, intent(in) :: j

The index of the sampler.

integer, intent(in) :: k

The index of the sampler.

integer, intent(in) :: contain(:)

The constraint in nI format.

integer(kind=n_int), intent(in) :: contain_ilut(0:)

The constraint in ilut (bitmask) format

real(kind=dp), intent(in) :: renormalization

The renormalization. (i.e. sum(this%get_prob(… contain…))

integer, intent(out) :: pos

The sampled value tgt and its position pos in `contain.

integer, intent(out) :: tgt

The sampled value tgt and its position pos in `contain.

real(kind=dp), intent(out) :: prob

The probability of sampling tgt from contain


Contents