Class TruncatedGaussianSampler

Class Documentation

class TruncatedGaussianSampler

Helper class for drawing samples from a TruncatedGaussian.

Public Functions

TruncatedGaussianSampler(TruncatedGaussian const &parent, TruncatedGaussian::SampleStrategy strategy)
Scalar operator()(afw::math::Random &rng, ndarray::Array<Scalar, 1, 1> const &alpha) const

Draw a single sample from a TruncatedGaussian.

Return

the weight of the sample (always betweeen 0 and 1)

Parameters
  • [in] rng: Random number generator

  • [out] alpha: Output sample vector to fill

void operator()(afw::math::Random &rng, ndarray::Array<Scalar, 2, 1> const &alpha, ndarray::Array<Scalar, 1, 1> const &weights, bool multiplyWeights = false) const

Draw multiple samples from a TruncatedGaussian.

Parameters
  • [in] rng: Random number generator

  • [out] alpha: Output sample vector to fill; first dimension sets the number of samples

  • [out] weights: Output weight vector to fill

  • [in] multiplyWeights: If true, multiply the weights vector by the weights rather than fill it.

~TruncatedGaussianSampler()