OpenKalman
Public Types | Public Member Functions | List of all members
OpenKalman::Covariance< StaticDescriptor, NestedMatrix > Struct Template Reference

A self-adjoint Covariance matrix. More...

#include <forward-class-declarations.hpp>

Inheritance diagram for OpenKalman::Covariance< StaticDescriptor, NestedMatrix >:
Inheritance graph
[legend]
Collaboration diagram for OpenKalman::Covariance< StaticDescriptor, NestedMatrix >:
Collaboration graph
[legend]

Public Types

using Scalar = scalar_type_of_t< NestedMatrix >
 Scalar type for this matrix.
 
- Public Types inherited from OpenKalman::internal::CovarianceImpl< Covariance< StaticDescriptor, NestedMatrix >, NestedMatrix >
using Scalar = scalar_type_of_t< NestedMatrix >
 Scalar type for this matrix.
 

Public Member Functions

template<typename T = Base, std::enable_if_t< std::is_default_constructible_v< T >, int > = 0>
 Covariance ()
 Default constructor.
 
template<typename M >
 Covariance (M &&m)
 Construct from another non-square-root covariance.
 
template<typename M , std::enable_if_t< covariance_nestable< M > and std::is_constructible_v< Base, M &&>, int > = 0>
 Covariance (M &&m)
 Construct from a covariance_nestable.
 
template<typename M , std::enable_if_t< typed_matrix< M > and(square_shaped< M > or(diagonal_matrix< NestedMatrix > and vector< M >)) and compares_with< vector_space_descriptor_of_t< M, 0 >, StaticDescriptor > and std::is_constructible_v< Base, decltype(oin::to_covariance_nestable< NestedSelfAdjoint >(std::declval< M &&>()))>, int > = 0>
 Covariance (M &&m)
 Construct from a typed_matrix. More...
 
template<typename M , std::enable_if_t< typed_matrix_nestable< M > and(not covariance_nestable< M >) and(square_shaped< M > or(diagonal_matrix< NestedMatrix > and vector< M >)) and std::is_constructible_v< Base, decltype(oin::to_covariance_nestable< NestedSelfAdjoint >(std::declval< M &&>()))>, int > = 0>
 Covariance (M &&m)
 Construct from a typed_matrix_nestable. More...
 
template<typename ... Args, std::enable_if_t<(std::is_convertible_v< Args, const Scalar > and ...) and((diagonal_matrix< NestedMatrix > and sizeof...(Args)==dim) or(sizeof...(Args)==dim *dim)) and std::is_constructible_v< Base, NestedSelfAdjoint &&>, int > = 0>
 Covariance (Args ... args)
 Construct from a row-major list of Scalar coefficients forming a self-adjoint matrix. More...
 
- Public Member Functions inherited from OpenKalman::internal::CovarianceImpl< Covariance< StaticDescriptor, NestedMatrix >, NestedMatrix >
auto covariance_op (const F1 &f1, const F2 &f2) const &
 
auto covariance_op (const F1 &f1, const F2 &f2) const &&
 
auto covariance_op (const F &f) const &
 
auto covariance_op (const F &f) const &&
 
decltype(auto) get_self_adjoint_nested_matrix () &
 
decltype(auto) get_self_adjoint_nested_matrix () const &
 
decltype(auto) get_self_adjoint_nested_matrix () &&
 
decltype(auto) get_self_adjoint_nested_matrix () const &&
 
decltype(auto) get_triangular_nested_matrix () &
 
decltype(auto) get_triangular_nested_matrix () const &
 
decltype(auto) get_triangular_nested_matrix () &&
 
decltype(auto) get_triangular_nested_matrix () const &&
 
auto determinant () const
 
auto operator() (std::size_t i, std::size_t j)
 Get or set element (i, j) of the covariance matrix. More...
 
auto operator() (std::size_t i, std::size_t j) const
 
auto operator() (std::size_t i)
 
auto operator() (std::size_t i) const
 
auto operator[] (std::size_t i)
 Get or set element i of the covariance matrix, if it is a vector. More...
 
auto operator[] (std::size_t i) const
 
void set_component (const Scalar s, const std::size_t i, const std::size_t j)
 Set an element of the cholesky nested matrix.
 
void set_component (const Scalar s, const std::size_t i)
 Set an element of the cholesky nested matrix.
 

Additional Inherited Members

- Protected Member Functions inherited from OpenKalman::internal::CovarianceImpl< Covariance< StaticDescriptor, NestedMatrix >, NestedMatrix >
decltype(auto) get_nested_matrix_impl () &
 
decltype(auto) get_nested_matrix_impl () const &
 
decltype(auto) get_nested_matrix_impl () &&
 
decltype(auto) get_nested_matrix_impl () const &&
 

Detailed Description

template<typename StaticDescriptor, typename NestedMatrix>
struct OpenKalman::Covariance< StaticDescriptor, NestedMatrix >

A self-adjoint Covariance matrix.

The coefficient types for the rows are the same as for the columns.

Template Parameters
DescriptorCoefficient types.
NestedMatrixThe underlying native matrix or matrix expression. It can be either self-adjoint or (either upper or lower) triangular. If it is triangular, the native matrix will be multiplied by its transpose when converted to a Matrix or when used in mathematical expressions. The self-adjoint and triangular versions are functionally identical, but often the triangular version is more efficient.

Constructor & Destructor Documentation

◆ Covariance() [1/3]

template<typename StaticDescriptor, typename NestedMatrix>
template<typename M , std::enable_if_t< typed_matrix< M > and(square_shaped< M > or(diagonal_matrix< NestedMatrix > and vector< M >)) and compares_with< vector_space_descriptor_of_t< M, 0 >, StaticDescriptor > and std::is_constructible_v< Base, decltype(oin::to_covariance_nestable< NestedSelfAdjoint >(std::declval< M &&>()))>, int > = 0>
OpenKalman::Covariance< StaticDescriptor, NestedMatrix >::Covariance ( M &&  m)
inlineexplicit

Construct from a typed_matrix.

M must be a square_shaped, unless NestedMatrix is a diagonal_matrix in which case M can be a column vector. M is assumed (without enforcement) to be self-adjoint, and the data in only one of the triangles is significant.

◆ Covariance() [2/3]

template<typename StaticDescriptor, typename NestedMatrix>
template<typename M , std::enable_if_t< typed_matrix_nestable< M > and(not covariance_nestable< M >) and(square_shaped< M > or(diagonal_matrix< NestedMatrix > and vector< M >)) and std::is_constructible_v< Base, decltype(oin::to_covariance_nestable< NestedSelfAdjoint >(std::declval< M &&>()))>, int > = 0>
OpenKalman::Covariance< StaticDescriptor, NestedMatrix >::Covariance ( M &&  m)
inlineexplicit

Construct from a typed_matrix_nestable.

M must be a square_shaped, unless NestedMatrix is a diagonal_matrix in which case M can be a column vector. M is assumed (without enforcement) to be self-adjoint, and the data in only one of the triangles is significant.

◆ Covariance() [3/3]

template<typename StaticDescriptor, typename NestedMatrix>
template<typename ... Args, std::enable_if_t<(std::is_convertible_v< Args, const Scalar > and ...) and((diagonal_matrix< NestedMatrix > and sizeof...(Args)==dim) or(sizeof...(Args)==dim *dim)) and std::is_constructible_v< Base, NestedSelfAdjoint &&>, int > = 0>
OpenKalman::Covariance< StaticDescriptor, NestedMatrix >::Covariance ( Args ...  args)
inline

Construct from a row-major list of Scalar coefficients forming a self-adjoint matrix.

The number of coefficients must match the size of the matrix (or the number of rows, if NestedMatrix is diagonal). The matrix is assumed (without enforcement) to be self-adjoint, but only the data in the lower-left triangle is significant.


The documentation for this struct was generated from the following file: