sampler_base_t Derived Type

type, public, abstract :: sampler_base_t

Base type for all samplers


Inherited by

type~~sampler_base_t~~InheritedByGraph type~sampler_base_t sampler_base_t type~weighted_sampler_t weighted_sampler_t type~weighted_sampler_t->type~sampler_base_t type~weighted_sampler_t~2 weighted_sampler_t type~weighted_sampler_t~2->type~sampler_base_t type~weighted_sampler_t~3 weighted_sampler_t type~weighted_sampler_t~3->type~sampler_base_t type~weighted_sampler_t~4 weighted_sampler_t type~weighted_sampler_t~4->type~sampler_base_t type~weighted_sampler_t~4->type~weighted_sampler_t~2 samplers type~weighted_sampler_t~5 weighted_sampler_t type~weighted_sampler_t~5->type~sampler_base_t type~weighted_sampler_t~5->type~weighted_sampler_t~3 samplers type~weighted_sampler_t~6 weighted_sampler_t type~weighted_sampler_t~6->type~sampler_base_t type~weighted_sampler_t~6->type~weighted_sampler_t btree type~weighted_sampler_t~6->type~weighted_sampler_t~2 samplers

Components

Type Visibility Attributes Name Initial
real(kind=dp), public, allocatable :: weights(:)
integer(kind=i4), public :: n = 0

Type-Bound Procedures

procedure(i_init_n), public, deferred :: init_n

  • subroutine i_init_n(this, n) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(sampler_base_t), intent(inout) :: this
    integer(kind=i4), intent(in) :: n

procedure(i_init_w), public, deferred :: init_w

  • subroutine i_init_w(this, n, w) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(sampler_base_t), intent(inout) :: this
    integer(kind=i4), intent(in) :: n
    real(kind=dp), intent(in) :: w

procedure(i_init_w2), public, deferred :: init_w2

  • subroutine i_init_w2(this, n, w1, w2) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(sampler_base_t), intent(inout) :: this
    integer(kind=i4), intent(in) :: n
    real(kind=dp), intent(in) :: w1
    real(kind=dp), intent(in) :: w2

generic, public :: init => init_n, init_w, init_w2

  • private subroutine sampler_init(this, n)

    Initializes the structure with N weights Input: n - number of weights

    Arguments

    Type IntentOptional Attributes Name
    class(weighted_sampler_t), intent(inout) :: this
    integer(kind=i4), intent(in) :: n
  • private subroutine sampler_init_w(this, n, w)

    Initializes with size n and threshold w Input: n - number of weights w - threshold for the weights

    Arguments

    Type IntentOptional Attributes Name
    class(weighted_sampler_t), intent(inout) :: this
    integer(kind=i4), intent(in) :: n
    real(kind=dp), intent(in) :: w
  • private subroutine sampler_init_w2(this, n, w1, w2)

    Placeholder for 1D initialization (compat mode), maps to original init Input: n - number of weights w1 - any real number, not used w2 - any real number, not used

    Arguments

    Type IntentOptional Attributes Name
    class(weighted_sampler_t), intent(inout) :: this
    integer(kind=i4), intent(in) :: n
    real(kind=dp), intent(in) :: w1
    real(kind=dp), intent(in) :: w2

procedure(i_reset), public, deferred :: reset

  • subroutine i_reset(this) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(sampler_base_t), intent(inout) :: this

procedure(i_set_weight), public, deferred :: set_weight

  • subroutine i_set_weight(this, index, weight) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(sampler_base_t), intent(inout) :: this
    integer(kind=i4), intent(in) :: index
    real(kind=dp), intent(in) :: weight

procedure(i_set_weight_array), public, deferred :: set_weight_array

  • subroutine i_set_weight_array(this, weights) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(sampler_base_t), intent(inout) :: this
    real(kind=dp), intent(in) :: weights(:)

procedure(i_add_weight), public, deferred :: add_weight

  • subroutine i_add_weight(this, index, delta_weight) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(sampler_base_t), intent(inout) :: this
    integer(kind=i4), intent(in) :: index
    real(kind=dp), intent(in) :: delta_weight

procedure(i_sample), public, deferred :: sample

  • function i_sample(this, gen) result(index) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(sampler_base_t), intent(in) :: this
    class(rndgen), intent(inout) :: gen

    Return Value integer(kind=i4)

procedure(i_remove), public, deferred :: remove

  • subroutine i_remove(this, index) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(sampler_base_t), intent(inout) :: this
    integer(kind=i4), intent(in) :: index

procedure(i_sum), public, deferred :: sum

  • function i_sum(this) result(total_weight) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(sampler_base_t), intent(in) :: this

    Return Value real(kind=dp)