Neutral Particle Reservoir
Li, Kim-Hung (4 December 1994). "Reservoir-Sampling Algorithms of Time Complexity O(n(1+log(N/n)))". ACM Transactions on Mathematical Software. 20 (4): 481–493. doi:10.1145/198429.198435
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=Int32), | public | :: | n | = | 0 | Number of neutral particles seen by the reservoir |
|
integer(kind=Int32), | public | :: | i | = | 0 | Number of the next particle that will be stored in the reservoir |
|
integer(kind=Int32), | public | :: | k | = | 0 | Size of the reservoir |
|
real(kind=Float64), | public | :: | W | = | 0.d0 | Sampling weight |
|
type(NeutralParticle), | public, | dimension(reservoir_size) | :: | R | Neutral Particle Reservoir |
type NeutralParticleReservoir
!+ Neutral Particle Reservoir
!+###References
!+ Li, Kim-Hung (4 December 1994). "Reservoir-Sampling Algorithms of Time
!+ Complexity O(n(1+log(N/n)))". ACM Transactions on Mathematical Software. 20
!+ (4): 481–493. doi:10.1145/198429.198435
integer(Int32) :: n = 0
!+ Number of neutral particles seen by the reservoir
integer(Int32) :: i = 0
!+ Number of the next particle that will be stored in the reservoir
integer(Int32) :: k = 0
!+ Size of the reservoir
real(Float64) :: W = 0.d0
!+ Sampling weight
type(NeutralParticle), dimension(reservoir_size) :: R
!+ Neutral Particle Reservoir
end type NeutralParticleReservoir