Constructor
Create a new rejection sampler with N weights Input: n - number of weights
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=i4), | intent(in) | :: | n |
Derived type, extending from the base
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=dp), | public, | allocatable | :: | weights(:) | |||
| integer(kind=i4), | public | :: | n | = | 0 | ||
| type(dynamical_list_t), | public, | allocatable | :: | indices | |||
| type(maxheap_t), | public, | allocatable | :: | heap | |||
| integer(kind=i4), | public, | allocatable | :: | position_of(:) | |||
| real(kind=dp), | public | :: | current_sum | = | 0.0_dp |
| final :: sampler_finalize |
| generic, public :: init => init_n, init_w, init_w2 | |
| procedure, public :: init_n => sampler_init | |
| procedure, public :: init_w => sampler_init_w | |
| procedure, public :: init_w2 => sampler_init_w2 | |
| procedure, public :: reset => sampler_reset | |
| procedure, public :: set_weight => sampler_set_weight | |
| procedure, public :: set_weight_array => sampler_set_weight_array | |
| procedure, public :: add_weight => sampler_add_weight | |
| procedure, public :: sample => sampler_sample | |
| procedure, public :: remove => sampler_remove | |
| procedure, public :: sum => sampler_sum |