Public Member Functions | Private Attributes | List of all members
ecl::CovarianceEllipsoid< double, 3 > Class Template Reference

Specialisation of covariance ellipsoids in three dimensions. More...

#include <covariance_ellipsoid.hpp>

Public Member Functions

const ecl::linear_algebra::Matrix3d & axes ()
 Returns the ellipse axes/covariance eigen vectors. More...
 
void compute (const ecl::linear_algebra::Matrix3d &M, const bool sort=true)
 Computes the covariance ellipsoid for the specified matrix. More...
 
 CovarianceEllipsoid ()
 Default constructor, use with compute(). More...
 
 CovarianceEllipsoid (const ecl::linear_algebra::Matrix3d &M, const bool sort=true)
 Automatically generates ellipsoid information at construction. More...
 
const ecl::linear_algebra::Vector3d & lengths ()
 Returns the precomputed ellipsoid minor/major axis lengths. More...
 
virtual ~CovarianceEllipsoid ()
 

Private Attributes

ecl::linear_algebra::Matrix3d ellipse_axes
 
ecl::linear_algebra::Vector3d ellipse_lengths
 

Detailed Description

template<>
class ecl::CovarianceEllipsoid< double, 3 >

Specialisation of covariance ellipsoids in three dimensions.

This creates ellipsoids for 3x3 covariance matrices, i.e. the usual sort for mobile robot navigation. It uses one of the eigen solvers. Currently it seems (we have not checked it thorougly yet) to correlate the order of eigenvalue-eigenvector pairs with the index of the matrix, which is good!

Usage:

This class is also more conveniently typedef'd as CovarianceEllipsoid3d.

You can either instantiate directly through the constructor or by hand via the compute() method. Recomputing is also possible without having to construct an entirely new instance.

CovarianceEllipsoid3d ellipsoid(M); // OR
CovarianceEllipsoid3d ellipsoid_hand;
ellipsoid_hand.compute(M);

Once generated, the ellipse properties can easily be extracted.

Vector3d lengths = ellipsoid.lengths(); // axis lengths.
See also
CovarianceEllipsoid.

Definition at line 438 of file covariance_ellipsoid.hpp.

Constructor & Destructor Documentation

◆ CovarianceEllipsoid() [1/2]

Default constructor, use with compute().

This constructor does not do anything - you must use it together with the compute() function. Sometimes useful when using this class with containers.

Definition at line 265 of file covariance_ellipsoid.cpp.

◆ CovarianceEllipsoid() [2/2]

ecl::CovarianceEllipsoid< double, 3 >::CovarianceEllipsoid ( const ecl::linear_algebra::Matrix3d &  M,
const bool  sort = true 
)

Automatically generates ellipsoid information at construction.

Using the specified input covariance matrix, this constructor automatically generates (indirectly calls compute()) the full ellipse information, making it instantly ready for use.

Parameters
M: the input covariance matrix (must be symmetric positive definite).
sort: if true, ensure the resulting set is a right-hand configuration.

Definition at line 270 of file covariance_ellipsoid.cpp.

◆ ~CovarianceEllipsoid()

virtual ecl::CovarianceEllipsoid< double, 3 >::~CovarianceEllipsoid ( )
inlinevirtual

Definition at line 460 of file covariance_ellipsoid.hpp.

Member Function Documentation

◆ axes()

const ecl::linear_algebra::Matrix3d& ecl::CovarianceEllipsoid< double, 3 >::axes ( )
inline

Returns the ellipse axes/covariance eigen vectors.

This returns the ellipse axes (aka covariance eigen vectors) as columns of a matrix.

Returns
Matrix2d : the set of eigenvectors as column vectors in a matrix.

Definition at line 493 of file covariance_ellipsoid.hpp.

◆ compute()

void ecl::CovarianceEllipsoid< double, 3 >::compute ( const ecl::linear_algebra::Matrix3d &  M,
const bool  sort = true 
)

Computes the covariance ellipsoid for the specified matrix.

This can either be called indirectly via the constructor or directly via this function. In either case, it resets the object and generates/computes the resulting ellipse from the specified input covariance matrix. By default it will sort and normalise the resulting eigenvectors so that they form a right handed system. You can turn this off by setting the sort argument to false.

Parameters
M: the input covariance matrix (must be symmetric positive definite).
sort: if true, ensure the resulting set is a right-hand configuration.

Definition at line 273 of file covariance_ellipsoid.cpp.

◆ lengths()

const ecl::linear_algebra::Vector3d& ecl::CovarianceEllipsoid< double, 3 >::lengths ( )
inline

Returns the precomputed ellipsoid minor/major axis lengths.

Returns the precomputed ellipsoid minor/major axis lengths.

Returns
Vector2d : the minor/major axis lengths.

Definition at line 484 of file covariance_ellipsoid.hpp.

Member Data Documentation

◆ ellipse_axes

ecl::linear_algebra::Matrix3d ecl::CovarianceEllipsoid< double, 3 >::ellipse_axes
private

Definition at line 499 of file covariance_ellipsoid.hpp.

◆ ellipse_lengths

ecl::linear_algebra::Vector3d ecl::CovarianceEllipsoid< double, 3 >::ellipse_lengths
private

Definition at line 498 of file covariance_ellipsoid.hpp.


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


ecl_statistics
Author(s): Daniel Stonier
autogenerated on Mon Feb 28 2022 22:18:40