LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
24 #ifndef LSST_MEAS_MODELFIT_TruncatedGaussian_h_INCLUDED
25 #define LSST_MEAS_MODELFIT_TruncatedGaussian_h_INCLUDED
36 namespace lsst {
namespace meas {
namespace modelfit {
38 class TruncatedGaussianSampler;
39 class TruncatedGaussianEvaluator;
40 class TruncatedGaussianLogEvaluator;
250 template <
typename Derived>
260 ndarray::Array<Scalar const,2,1>
const & alpha,
261 ndarray::Array<Scalar,1,1>
const & output
281 template <
typename Derived>
289 ndarray::Array<Scalar const,2,1>
const & alpha,
290 ndarray::Array<Scalar,1,1>
const & output
329 ndarray::Array<Scalar,2,1>
const & alpha,
330 ndarray::Array<Scalar,1,1>
const & weights,
331 bool multiplyWeights=
false
343 return Sampler(*
this, strategy);
359 #endif // !LSST_MEAS_MODELFIT_TruncatedGaussian_h_INCLUDED
SampleStrategy
Enum that describes different ways of sampling from a multidimensional TruncatedGaussian.
Represents a multidimensional Gaussian function truncated at zero.
TruncatedGaussianEvaluator(TruncatedGaussian const &parent)
TruncatedGaussianSampler Sampler
static TruncatedGaussian fromStandardParameters(Vector const &mean, Matrix const &covariance)
Create from the "standard" mean and covariance parameters of the normal distribution.
double Scalar
Typedefs to be used for probability and parameter values.
Scalar getUntruncatedFraction() const
Return the fraction of the Gaussian integral that was truncated by the bounds.
Scalar operator()(afw::math::Random &rng, ndarray::Array< Scalar, 1, 1 > const &alpha) const
Draw a single sample from a TruncatedGaussian.
static TruncatedGaussian fromSeriesParameters(Scalar q0, Vector const &gradient, Matrix const &hessian)
Create from the first and second logarithmic derivatives of the Gaussian.
Vector maximize() const
Return the location of the maximum of the truncated Gaussian.
Scalar operator()(ndarray::Array< Scalar const, 1, 1 > const &alpha) const
Helper class for drawing samples from a TruncatedGaussian.
int getDim() const
Return the dimensionality of the function.
Evaluator evaluate() const
Create an Evaluator object that can be used to efficiently evaluate the function.
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.
TruncatedGaussianSampler(TruncatedGaussian const &parent, TruncatedGaussian::SampleStrategy strategy)
@ DIRECT_WITH_REJECTION
Draw from the untruncated Gaussian, and discard negative draws.
Helper class for evaluating the -log of a TruncatedGaussian.
Scalar operator()(Eigen::MatrixBase< Derived > const &alpha) const
void operator()(ndarray::Array< Scalar const, 2, 1 > const &alpha, ndarray::Array< Scalar, 1, 1 > const &output) const
TruncatedGaussianLogEvaluator(TruncatedGaussian const &parent)
bool any(CoordinateExpr< N > const &expr) noexcept
Return true if any elements are true.
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Scalar getLogPeakAmplitude() const
Return the -log of the peak amplitude of the untruncated function.
@ ALIGN_AND_WEIGHT
Create a similar Gaussian with no x-y covariance, and importance sample by drawing from the independe...
A base class for image defects.
~TruncatedGaussianSampler()
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
Scalar getLogIntegral() const
Return the -log of the integral of the truncated function.
Scalar operator()(Eigen::MatrixBase< Derived > const &alpha) const
A class that can be used to generate sequences of random numbers according to a number of different a...
LogEvaluator evaluateLog() const
Create a LogEvaluator object that can be used to efficiently evaluate the -log of the function.
Helper class for evaluating the -log of a TruncatedGaussian.
TruncatedGaussianLogEvaluator LogEvaluator
void operator()(ndarray::Array< Scalar const, 2, 1 > const &alpha, ndarray::Array< Scalar, 1, 1 > const &output) const
Sampler sample(SampleStrategy strategy) const
Create a Sampler object that uses the given strategy.
TruncatedGaussianEvaluator Evaluator
Scalar operator()(ndarray::Array< Scalar const, 1, 1 > const &alpha) const