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

The upper or lower triangle Cholesky factor (square root) of a covariance matrix. More...

#include <forward-class-declarations.hpp>

Inheritance diagram for OpenKalman::SquareRootCovariance< StaticDescriptor, NestedMatrix >:
Inheritance graph
[legend]
Collaboration diagram for OpenKalman::SquareRootCovariance< 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< SquareRootCovariance< 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>
 SquareRootCovariance ()
 Default constructor.
 
template<typename M >
 SquareRootCovariance (M &&m)
 Construct from another triangular_covariance.
 
template<typename M , std::enable_if_t< covariance_nestable< M > and std::is_constructible_v< Base, M &&>, int > = 0>
 SquareRootCovariance (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< NestedTriangular >(std::declval< M &&>()))>, int > = 0>
 SquareRootCovariance (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< NestedTriangular >(std::declval< M &&>()))>, int > = 0>
 SquareRootCovariance (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, NestedTriangular &&>, int > = 0>
 SquareRootCovariance (Args ... args)
 Construct from Scalar coefficients. Assumes matrix is triangular, and only reads lower left triangle.
 
template<typename Arg >
auto & operator= (Arg &&other)
 Assign from a compatible triangular_covariance. More...
 
template<typename Arg , std::enable_if_t< typed_matrix< Arg > and square_shaped< Arg > and compares_with< vector_space_descriptor_of_t< Arg, 0 >, StaticDescriptor > and std::is_assignable_v< std::add_lvalue_reference_t< NestedMatrix >, NestedTriangular >, int > = 0>
auto & operator= (Arg &&other)
 Assign from a compatible typed_matrix (assumed, without checking, to be triangular).
 
- Public Member Functions inherited from OpenKalman::internal::CovarianceImpl< SquareRootCovariance< 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< SquareRootCovariance< 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::SquareRootCovariance< StaticDescriptor, NestedMatrix >

The upper or lower triangle Cholesky factor (square root) of a covariance matrix.

If S is a SquareRootCovariance, S*transpose(S) is a Covariance. If NestedMatrix is triangular, the SquareRootCovariance has the same triangle type (upper or lower). If NestedMatrix is self-adjoint, the triangle type of SquareRootCovariance is considered either upper ''or'' lower.

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 self-adjoint, the native matrix will be Cholesky-factored 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

◆ SquareRootCovariance() [1/2]

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< NestedTriangular >(std::declval< M &&>()))>, int > = 0>
OpenKalman::SquareRootCovariance< StaticDescriptor, NestedMatrix >::SquareRootCovariance ( 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 triangular, and the data in only one of the triangles is significant.

◆ SquareRootCovariance() [2/2]

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< NestedTriangular >(std::declval< M &&>()))>, int > = 0>
OpenKalman::SquareRootCovariance< StaticDescriptor, NestedMatrix >::SquareRootCovariance ( 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 triangular, and the data in only one of the triangles is significant.

Member Function Documentation

◆ operator=()

template<typename StaticDescriptor, typename NestedMatrix>
template<typename Arg >
auto& OpenKalman::SquareRootCovariance< StaticDescriptor, NestedMatrix >::operator= ( Arg &&  other)
inline

Assign from a compatible triangular_covariance.

Note
the triangle types must match.

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