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;
173 Sampler
sample(
Scalar minRejectionEfficiency=0.1)
const;
250 template <
typename Derived>
253 _workspace = alpha - _mu;
254 return 0.5*(_rootH*_workspace).squaredNorm() + _norm;
257 Scalar operator()(ndarray::Array<Scalar const,1,1>
const & alpha)
const;
260 ndarray::Array<Scalar const,2,1>
const & alpha,
261 ndarray::Array<Scalar,1,1>
const &
output 281 template <
typename Derived>
286 Scalar operator()(ndarray::Array<Scalar const,1,1>
const & alpha)
const;
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 friend class TruncatedGaussianSampler
static TruncatedGaussian fromStandardParameters(Vector const &mean, Matrix const &covariance)
Create from the "standard" mean and covariance parameters of the normal distribution.
TruncatedGaussianLogEvaluator LogEvaluator
Scalar getLogPeakAmplitude() const
Return the -log of the peak amplitude of the untruncated function.
TruncatedGaussianEvaluator(TruncatedGaussian const &parent)
Helper class for drawing samples from a TruncatedGaussian.
Sampler sample(SampleStrategy strategy) const
Create a Sampler object that uses the given strategy.
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.
friend class TruncatedGaussianLogEvaluator
Scalar operator()(Eigen::MatrixBase< Derived > const &alpha) const
A base class for image defects.
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
Typedefs to be used for probability and parameter values.
Represents a multidimensional Gaussian function truncated at zero.
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Typedefs to be used for probability and parameter values.
Vector maximize() const
Return the location of the maximum of the truncated Gaussian.
SampleStrategy
Enum that describes different ways of sampling from a multidimensional TruncatedGaussian.
Helper class for evaluating the -log of a TruncatedGaussian.
Create a similar Gaussian with no x-y covariance, and importance sample by drawing from the independe...
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.
Evaluator evaluate() const
Create an Evaluator object that can be used to efficiently evaluate the function. ...
Draw from the untruncated Gaussian, and discard negative draws.
Scalar operator()(Eigen::MatrixBase< Derived > const &alpha) const
TruncatedGaussianEvaluator Evaluator
TruncatedGaussianSampler Sampler
int getDim() const
Return the dimensionality of the function.
Scalar getLogIntegral() const
Return the -log of the integral of the truncated function.
static TruncatedGaussian fromSeriesParameters(Scalar q0, Vector const &gradient, Matrix const &hessian)
Create from the first and second logarithmic derivatives of the Gaussian.
A class that can be used to generate sequences of random numbers according to a number of different a...