Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | List of all members
gtsam::noiseModel::Gaussian Class Reference

#include <NoiseModel.h>

Inheritance diagram for gtsam::noiseModel::Gaussian:
Inheritance graph
[legend]

Public Types

typedef std::shared_ptr< Gaussianshared_ptr
 
- Public Types inherited from gtsam::noiseModel::Base
typedef std::shared_ptr< Baseshared_ptr
 

Public Member Functions

virtual Matrix covariance () const
 Compute covariance matrix. More...
 
bool equals (const Base &expected, double tol=1e-9) const override
 
 Gaussian (size_t dim=1, const std::optional< Matrix > &sqrt_information={})
 
virtual Matrix information () const
 Compute information matrix. More...
 
void print (const std::string &name) const override
 
virtual std::shared_ptr< DiagonalQR (Matrix &Ab) const
 
virtual Matrix R () const
 Return R itself, but note that Whiten(H) is cheaper than R*H. More...
 
Vector sigmas () const override
 Calculate standard deviations. More...
 
Vector unwhiten (const Vector &v) const override
 Unwhiten an error vector. More...
 
Vector whiten (const Vector &v) const override
 Whiten an error vector. More...
 
Matrix Whiten (const Matrix &H) const override
 
virtual void WhitenInPlace (Matrix &H) const
 
virtual void WhitenInPlace (Eigen::Block< Matrix > H) const
 
void WhitenSystem (std::vector< Matrix > &A, Vector &b) const override
 
void WhitenSystem (Matrix &A, Vector &b) const override
 
void WhitenSystem (Matrix &A1, Matrix &A2, Vector &b) const override
 
void WhitenSystem (Matrix &A1, Matrix &A2, Matrix &A3, Vector &b) const override
 
 ~Gaussian () override
 
- Public Member Functions inherited from gtsam::noiseModel::Base
 Base (size_t dim=1)
 primary constructor More...
 
size_t dim () const
 Dimensionality. More...
 
virtual bool isConstrained () const
 true if a constrained noise model, saves slow/clumsy dynamic casting More...
 
virtual bool isUnit () const
 true if a unit noise model, saves slow/clumsy dynamic casting More...
 
virtual double loss (const double squared_distance) const
 loss function, input is Mahalanobis distance More...
 
virtual double mahalanobisDistance (const Vector &v) const
 Mahalanobis distance. More...
 
virtual double squaredMahalanobisDistance (const Vector &v) const
 Squared Mahalanobis distance v'*R'*R*v = <R*v,R*v> More...
 
virtual Vector unweightedWhiten (const Vector &v) const
 
virtual void unwhitenInPlace (Vector &v) const
 
virtual void unwhitenInPlace (Eigen::Block< Vector > &v) const
 
virtual double weight (const Vector &v) const
 
virtual void whitenInPlace (Vector &v) const
 
virtual void whitenInPlace (Eigen::Block< Vector > &v) const
 
virtual ~Base ()
 

Static Public Member Functions

static shared_ptr Covariance (const Matrix &covariance, bool smart=true)
 
static shared_ptr Information (const Matrix &M, bool smart=true)
 
static shared_ptr SqrtInformation (const Matrix &R, bool smart=true)
 

Protected Attributes

std::optional< Matrixsqrt_information_
 
- Protected Attributes inherited from gtsam::noiseModel::Base
size_t dim_
 

Private Member Functions

const MatrixthisR () const
 

Detailed Description

Gaussian implements the mathematical model |R*x|^2 = |y|^2 with R'*R=inv(Sigma) where y = whiten(x) = R*x x = unwhiten(x) = inv(R)*y as indeed |y|^2 = y'*y = x'*R'*R*x Various derived classes are available that are more efficient. The named constructors return a shared_ptr because, when the smart flag is true, the underlying object might be a derived class such as Diagonal.

Definition at line 168 of file NoiseModel.h.

Member Typedef Documentation

◆ shared_ptr

Definition at line 189 of file NoiseModel.h.

Constructor & Destructor Documentation

◆ Gaussian()

gtsam::noiseModel::Gaussian::Gaussian ( size_t  dim = 1,
const std::optional< Matrix > &  sqrt_information = {} 
)
inline

constructor takes square root information matrix

Definition at line 192 of file NoiseModel.h.

◆ ~Gaussian()

gtsam::noiseModel::Gaussian::~Gaussian ( )
inlineoverride

Definition at line 196 of file NoiseModel.h.

Member Function Documentation

◆ Covariance()

Gaussian::shared_ptr gtsam::noiseModel::Gaussian::Covariance ( const Matrix covariance,
bool  smart = true 
)
static

A Gaussian noise model created by specifying a covariance matrix.

Parameters
covarianceThe square covariance Matrix
smartcheck if can be simplified to derived class

Definition at line 114 of file NoiseModel.cpp.

◆ covariance()

Matrix gtsam::noiseModel::Gaussian::covariance ( ) const
virtual

Compute covariance matrix.

Definition at line 147 of file NoiseModel.cpp.

◆ equals()

bool gtsam::noiseModel::Gaussian::equals ( const Base expected,
double  tol = 1e-9 
) const
overridevirtual

Implements gtsam::noiseModel::Base.

Definition at line 139 of file NoiseModel.cpp.

◆ Information()

Gaussian::shared_ptr gtsam::noiseModel::Gaussian::Information ( const Matrix M,
bool  smart = true 
)
static

A Gaussian noise model created by specifying an information matrix.

Parameters
MThe information matrix
smartcheck if can be simplified to derived class

Definition at line 97 of file NoiseModel.cpp.

◆ information()

Matrix gtsam::noiseModel::Gaussian::information ( ) const
virtual

Compute information matrix.

Definition at line 239 of file NoiseModel.cpp.

◆ print()

void gtsam::noiseModel::Gaussian::print ( const std::string &  name) const
overridevirtual

◆ QR()

SharedDiagonal gtsam::noiseModel::Gaussian::QR ( Matrix Ab) const
virtual

Apply appropriately weighted QR factorization to the system [A b] Q' * [A b] = [R d] Dimensions: (r*m) * m*(n+1) = r*(n+1), where r = min(m,n). This routine performs an in-place factorization on Ab. Below-diagonal elements are set to zero by this routine.

Parameters
Abis the m*(n+1) augmented system matrix [A b]
Returns
Empty SharedDiagonal() noise model: R,d are whitened

Reimplemented in gtsam::noiseModel::Constrained.

Definition at line 189 of file NoiseModel.cpp.

◆ R()

virtual Matrix gtsam::noiseModel::Gaussian::R ( ) const
inlinevirtual

Return R itself, but note that Whiten(H) is cheaper than R*H.

Reimplemented in gtsam::noiseModel::Diagonal.

Definition at line 261 of file NoiseModel.h.

◆ sigmas()

Vector gtsam::noiseModel::Gaussian::sigmas ( ) const
overridevirtual

Calculate standard deviations.

Reimplemented from gtsam::noiseModel::Base.

Reimplemented in gtsam::noiseModel::Diagonal.

Definition at line 158 of file NoiseModel.cpp.

◆ SqrtInformation()

Gaussian::shared_ptr gtsam::noiseModel::Gaussian::SqrtInformation ( const Matrix R,
bool  smart = true 
)
static

A Gaussian noise model created by specifying a square root information matrix.

Parameters
RThe (upper-triangular) square root information matrix
smartcheck if can be simplified to derived class

Definition at line 83 of file NoiseModel.cpp.

◆ thisR()

const Matrix& gtsam::noiseModel::Gaussian::thisR ( ) const
inlineprivate

Return R itself, but note that Whiten(H) is cheaper than R*H

Definition at line 180 of file NoiseModel.h.

◆ unwhiten()

Vector gtsam::noiseModel::Gaussian::unwhiten ( const Vector v) const
overridevirtual

Unwhiten an error vector.

Implements gtsam::noiseModel::Base.

Reimplemented in gtsam::noiseModel::Unit, gtsam::noiseModel::Isotropic, and gtsam::noiseModel::Diagonal.

Definition at line 168 of file NoiseModel.cpp.

◆ whiten()

Vector gtsam::noiseModel::Gaussian::whiten ( const Vector v) const
overridevirtual

◆ Whiten()

Matrix gtsam::noiseModel::Gaussian::Whiten ( const Matrix H) const
overridevirtual

Multiply a derivative with R (derivative of whiten) Equivalent to whitening each column of the input matrix.

Implements gtsam::noiseModel::Base.

Reimplemented in gtsam::noiseModel::Unit, gtsam::noiseModel::Isotropic, gtsam::noiseModel::Constrained, and gtsam::noiseModel::Diagonal.

Definition at line 173 of file NoiseModel.cpp.

◆ WhitenInPlace() [1/2]

void gtsam::noiseModel::Gaussian::WhitenInPlace ( Matrix H) const
virtual

◆ WhitenInPlace() [2/2]

void gtsam::noiseModel::Gaussian::WhitenInPlace ( Eigen::Block< Matrix H) const
virtual

◆ WhitenSystem() [1/4]

void gtsam::noiseModel::Gaussian::WhitenSystem ( std::vector< Matrix > &  A,
Vector b 
) const
overridevirtual

Whiten a system, in place as well

Implements gtsam::noiseModel::Base.

Definition at line 216 of file NoiseModel.cpp.

◆ WhitenSystem() [2/4]

void gtsam::noiseModel::Gaussian::WhitenSystem ( Matrix A,
Vector b 
) const
overridevirtual

Implements gtsam::noiseModel::Base.

Definition at line 221 of file NoiseModel.cpp.

◆ WhitenSystem() [3/4]

void gtsam::noiseModel::Gaussian::WhitenSystem ( Matrix A1,
Matrix A2,
Vector b 
) const
overridevirtual

Implements gtsam::noiseModel::Base.

Definition at line 226 of file NoiseModel.cpp.

◆ WhitenSystem() [4/4]

void gtsam::noiseModel::Gaussian::WhitenSystem ( Matrix A1,
Matrix A2,
Matrix A3,
Vector b 
) const
overridevirtual

Implements gtsam::noiseModel::Base.

Definition at line 232 of file NoiseModel.cpp.

Member Data Documentation

◆ sqrt_information_

std::optional<Matrix> gtsam::noiseModel::Gaussian::sqrt_information_
protected

Matrix square root of information matrix (R)

Definition at line 173 of file NoiseModel.h.


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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:47:20