queso-0.53.0
Public Member Functions | Private Attributes | List of all members
QUESO::InfiniteDimensionalGaussian Class Reference

Class defining infinite dimensional Gaussian measures. More...

#include <InfiniteDimensionalGaussian.h>

Inheritance diagram for QUESO::InfiniteDimensionalGaussian:
Inheritance graph
[legend]
Collaboration diagram for QUESO::InfiniteDimensionalGaussian:
Collaboration graph
[legend]

Public Member Functions

virtual boost::shared_ptr
< FunctionBase
draw ()
 Draw from the measure, and then return a shared pointer to the draw. More...
 
virtual double get_kl_coefficient (unsigned int i) const
 Return coefficient i of the KL expansion of the current draw. Must be called after draw() More...
 
Constructor/Destructor methods
 InfiniteDimensionalGaussian (const FullEnvironment &env, const FunctionBase &mean, const OperatorBase &precision, double alpha, double beta)
 Construct a Gaussian with mean mean, precision operator precision. alpha controls regularity of draws and beta^2 is a multiplicative coefficient of precision. More...
 
 ~InfiniteDimensionalGaussian ()
 Destructor. More...
 
- Public Member Functions inherited from QUESO::InfiniteDimensionalMeasureBase
 InfiniteDimensionalMeasureBase ()
 Default constructor. More...
 
virtual ~InfiniteDimensionalMeasureBase ()
 Destructor. More...
 

Private Attributes

const FunctionBasemean
 
const OperatorBaseprecision
 
const FullEnvironmentenv
 
double alpha
 
double beta
 
std::vector< double > coeffs
 

Detailed Description

Class defining infinite dimensional Gaussian measures.

Definition at line 50 of file InfiniteDimensionalGaussian.h.

Constructor & Destructor Documentation

QUESO::InfiniteDimensionalGaussian::InfiniteDimensionalGaussian ( const FullEnvironment env,
const FunctionBase mean,
const OperatorBase precision,
double  alpha,
double  beta 
)

Construct a Gaussian with mean mean, precision operator precision. alpha controls regularity of draws and beta^2 is a multiplicative coefficient of precision.

The argument alpha refers to the power to which the precision will be taken. And beta is the multiplicative coefficient of preicision. The complete measure is therefore:

N(mean, beta^2 * pow(precision, alpha))

It is expected that mean and precision will live longer than this

Definition at line 38 of file InfiniteDimensionalGaussian.C.

References coeffs, and QUESO::OperatorBase::get_num_converged().

45  mean(mean),
47  env(env),
48  alpha(alpha),
49  beta(beta)
50 {
51  this->coeffs.resize(this->precision.get_num_converged(), 0.0);
52 }
virtual unsigned int get_num_converged() const =0
Return the number of converged eigenpairs.
QUESO::InfiniteDimensionalGaussian::~InfiniteDimensionalGaussian ( )

Destructor.

Definition at line 54 of file InfiniteDimensionalGaussian.C.

55 {
56 }

Member Function Documentation

boost::shared_ptr< FunctionBase > QUESO::InfiniteDimensionalGaussian::draw ( )
virtual

Draw from the measure, and then return a shared pointer to the draw.

Implements QUESO::InfiniteDimensionalMeasureBase.

Definition at line 58 of file InfiniteDimensionalGaussian.C.

References beta, coeffs, env, QUESO::RngBase::gaussianSample(), QUESO::OperatorBase::get_num_converged(), QUESO::OperatorBase::inverse_kl_transform(), precision, and QUESO::BaseEnvironment::rngObject().

59 {
60  unsigned int i;
61 
62  for (i = 0; i < this->precision.get_num_converged(); i++) {
63  (this->coeffs)[i] = env.rngObject()->gaussianSample(this->beta);
64  }
65 
66  boost::shared_ptr<FunctionBase> f(this->precision.inverse_kl_transform(this->coeffs, this->alpha));
67  return f;
68 }
virtual double gaussianSample(double stdDev) const =0
Samples a value from a Gaussian distribution with standard deviation given by stdDev.
virtual boost::shared_ptr< FunctionBase > inverse_kl_transform(std::vector< double > &xi, double alpha) const =0
Given coefficients xi, computes the Karhunen-Loeve transform.
const RngBase * rngObject() const
Access to the RNG object.
Definition: Environment.C:417
virtual unsigned int get_num_converged() const =0
Return the number of converged eigenpairs.
double QUESO::InfiniteDimensionalGaussian::get_kl_coefficient ( unsigned int  i) const
virtual

Return coefficient i of the KL expansion of the current draw. Must be called after draw()

Implements QUESO::InfiniteDimensionalMeasureBase.

Definition at line 70 of file InfiniteDimensionalGaussian.C.

References alpha, coeffs, QUESO::OperatorBase::get_eigenvalue(), and precision.

71 {
72  // This is code repetition, but I'm not quite sure this belongs
73  // in the operator class, because it's useful in the measure
74  return (this->coeffs)[i] / pow(this->precision.get_eigenvalue(i), this->alpha / 2.0);
75 }
virtual double get_eigenvalue(unsigned int i) const =0
Return eigenvalue i.

Member Data Documentation

double QUESO::InfiniteDimensionalGaussian::alpha
private

Definition at line 89 of file InfiniteDimensionalGaussian.h.

Referenced by get_kl_coefficient().

double QUESO::InfiniteDimensionalGaussian::beta
private

Definition at line 92 of file InfiniteDimensionalGaussian.h.

Referenced by draw().

std::vector<double> QUESO::InfiniteDimensionalGaussian::coeffs
private
const FullEnvironment& QUESO::InfiniteDimensionalGaussian::env
private

Definition at line 86 of file InfiniteDimensionalGaussian.h.

Referenced by draw().

const FunctionBase& QUESO::InfiniteDimensionalGaussian::mean
private

Definition at line 80 of file InfiniteDimensionalGaussian.h.

const OperatorBase& QUESO::InfiniteDimensionalGaussian::precision
private

Definition at line 83 of file InfiniteDimensionalGaussian.h.

Referenced by draw(), and get_kl_coefficient().


The documentation for this class was generated from the following files:

Generated on Thu Jun 11 2015 13:52:34 for queso-0.53.0 by  doxygen 1.8.5