EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
Loading...
Searching...
No Matches
Emrys::EachRepetition< F, BlockSpace > Class Template Reference

One factor on every repetition of a repeated block: the product of independent copies of a density, one per repetition, as a density over the whole block (decisions.md [product-factors]). More...

#include <EmrysFilter/Distributions/Product.h>

Public Types

using Scalar = typename F::Scalar
 the scalar type
using Index = Eigen::Index
 Eigen's index type.
using SpaceType = BlockSpace
 the space the values live in
using MomentsType = Moments<BlockSpace, Scalar>
 a mean and covariance together
using VectorType = typename MomentsType::VectorType
 a value

Public Member Functions

 EachRepetition (F factor, BlockSpace space)
 factor on each repetition of space.
F const & factor () const
BlockSpace const & space () const
Index count () const
Index valueDimension () const
template<typename Derived>
Scalar logDensity (Eigen::MatrixBase< Derived > const &x) const
auto moments () const -> std::conditional_t< MomentsMayFail, std::expected< MomentsType, MomentsError >, MomentsType >

Static Public Attributes

static constexpr int ValueDimensionAtCompileTime = MomentsType::ValueDimensionAtCompileTime
 the length of a value, or Eigen::Dynamic
static constexpr int MaxValueDimensionAtCompileTime = MomentsType::MaxValueDimensionAtCompileTime
 a bound on the length of a value, or Eigen::Dynamic

Detailed Description

template<ProductFactor F, Space BlockSpace>
class Emrys::EachRepetition< F, BlockSpace >

One factor on every repetition of a repeated block: the product of independent copies of a density, one per repetition, as a density over the whole block (decisions.md [product-factors]).

onEach<Path>() makes one when a Product is placed, from the block's space there, so its count is the space instance's: a Gaussian factor with covariance \( R \) gives the block the covariance \( I \otimes R \). The factor is a density or parameters (see ProductFactor), in the space of the repeated block's one repetition, and its parameters are checked once, here.

Template Parameters
Fthe factor's type, over one repetition
BlockSpacethe repeated block's space, a Repeated or a tag derived from one
See also
onEach(), class Product

Member Function Documentation

◆ count()

template<ProductFactor F, Space BlockSpace>
Index Emrys::EachRepetition< F, BlockSpace >::count ( ) const
inlinenodiscard
Returns
the number of repetitions

◆ factor()

template<ProductFactor F, Space BlockSpace>
F const & Emrys::EachRepetition< F, BlockSpace >::factor ( ) const
inlinenodiscard
Returns
the factor on one repetition, as stored

◆ logDensity()

template<ProductFactor F, Space BlockSpace>
template<typename Derived>
Scalar Emrys::EachRepetition< F, BlockSpace >::logDensity ( Eigen::MatrixBase< Derived > const & x) const
inlinenodiscard
Returns
the log of the density at x: the sum of the factor's log-densities at the repetitions

◆ moments()

template<ProductFactor F, Space BlockSpace>
auto Emrys::EachRepetition< F, BlockSpace >::moments ( ) const -> std::conditional_t< MomentsMayFail, std::expected< MomentsType, MomentsError >, MomentsType >
inlinenodiscard
Returns
the mean and covariance: the factor's moments at each repetition, and zero covariance between repetitions. If the factor's moments() can fail, so can this.

◆ space()

template<ProductFactor F, Space BlockSpace>
BlockSpace const & Emrys::EachRepetition< F, BlockSpace >::space ( ) const
inlinenodiscard
Returns
the block's space, with its count

◆ valueDimension()

template<ProductFactor F, Space BlockSpace>
Index Emrys::EachRepetition< F, BlockSpace >::valueDimension ( ) const
inlinenodiscard
Returns
the number of coordinates of the block

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