Public Member Functions | Protected Member Functions | Protected Attributes
softAbsMetric Class Reference

#include <softAbsMetric.h>

Inheritance diagram for softAbsMetric:
dynamMetric baseHamiltonian softAbsBayesLogReg softAbsFunnel

List of all members.

Public Member Functions

 softAbsMetric (int dim)
double T ()
 Return the kinetic energy.
double tau ()
 Return the quadratic form of the kinetic energy.
MatrixXd Lambda ()
 Return the inverse SoftAbs metric.
void bounceP (const VectorXd &normal)
SelfAdjointEigenSolver
< MatrixXd > & 
eigenDeco ()
 Return the eigendecomposition of the metric.
VectorXd & lambdaDotP ()
 Calculate the product of the metric with the current momentum.
void sampleP (Random &random)
void setSoftAbsAlpha (double alpha)
 Set the SoftAbs regularization coefficient.
void checkEvolution (const double epsilon=1e-6)
 Comparing the evolution implementations with finite differences.
void displayState ()
 Display current state.

Protected Member Functions

virtual void fComputeH ()=0
 Compute the Hessian at the current position.
virtual void fComputeGradH (int i)=0
 Compute the ith component of the gradient of the Hessian.
void fComputeMetric ()
void fPrepareSpatialGradients ()
 Compute intermediate values necessary for the spatial gradients dTaudq and dPhidq.
void fUpdateP ()
 Update any momenta-dependent auxiliary terms.
VectorXd & dTaudp ()
 Gradient of the quadrtic form with respect to the momenta.
VectorXd & dTaudq ()
 Gradient of the quadratic form with respect to the position.
VectorXd & dPhidq ()
 Gradient of the psuedo-potential with respect to the momenta.

Protected Attributes

double mSoftAbsAlpha
 Regularization coefficient.
MatrixXd mH
 Hessian.
MatrixXd mGradH
 Gradient of the Hessian.
MatrixXd mPseudoJ
 Discrete "pseudo-Jacobian" of the SoftAbs transform.
MatrixXd mAuxMatrixOne
 Auxiliary matrix for intermediate matrix calcs.
MatrixXd mAuxMatrixTwo
 Auxiliary matrix for intermediate matrix calcs.
MatrixXd mCacheMatrix
 Auxiliary matrix for caching spatial gradient terms.
SelfAdjointEigenSolver< MatrixXd > mEigenDeco
 Eigendecomposition of the metric.
VectorXd mSoftAbsLambda
 Transformed eigenvalues.
VectorXd mSoftAbsLambdaInv
 Repciprocal of the transformed eigenvalues.
VectorXd mQp
 Auxiliary vector for intermediate matrix calcs.
VectorXd mLambdaQp
 Auxiliary vector for intermediate matrix calcs.

Detailed Description

Author:
Michael Betancourt

Abstract base class defining the interface for a Hamiltonian defined on a Riemannian manifold with a SoftAbs Metric


Constructor & Destructor Documentation

softAbsMetric::softAbsMetric ( int  dim) [explicit]

Constructor

Parameters:
dimDimension of the target space

Member Function Documentation

void softAbsMetric::bounceP ( const VectorXd &  normal) [virtual]

Evolve the momentum through a bounce off of a constraint surface

Parameters:
normalVector normal to constraint surface

Implements baseHamiltonian.

void softAbsMetric::checkEvolution ( const double  epsilon = 1e-6) [virtual]

Comparing the evolution implementations with finite differences.

Compare the position and momentum evolution implementations with finite differences

Parameters:
epsilonSize of finite difference step

Reimplemented from baseHamiltonian.

void softAbsMetric::fComputeMetric ( ) [protected, virtual]

Compute the metric at the current position, performing an eigen decomposition and computing the log determinant

Implements dynamMetric.

void softAbsMetric::sampleP ( Random &  random) [virtual]

Sample the momentum from the conditional distribution $ \pi \left( \mathbf{p} | \mathbf{q} \right) \propto \exp \left( - T \left( \mathbf{p}, \mathbf{q} \right) \right) $

Parameters:
randomExternal RandomLib generator

Implements baseHamiltonian.

Examples:
examples/main.cpp.

The documentation for this class was generated from the following files:
 All Classes Functions Variables