EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
Loading...
Searching...
No Matches
Space.h File Reference

The Space concept and what every continuous space shares (decisions.md [sizes-and-dimensions]): the traits a space exposes, DifferenceSpace, valueDimension(), differenceDimension(), and allowsValueDimension(); ValueVector, DifferenceVector, and DifferenceMatrix, the Eigen types a space sizes; isLinear<> and its parts; writable(); and the free functions plus(), minus(), less(), normalizeValues(), and normalizeDifferences(), which add and subtract where a space has no plus() or minus() of its own [difference-spaces]. More...

#include <concepts>
#include <type_traits>
#include <utility>
#include <EmrysFilter/Core/Macros.h>
#include <EmrysFilter/Core/Math.h>

Go to the source code of this file.

Concepts

concept  Emrys::Space
 A type usable as the space of a distribution.
concept  Emrys::FixedSizeSpace
 A space whose instance holds nothing, so that S{} is the only one there is: a space of fixed size, continuous or discrete, which is an empty type (decisions.md [space-storage]).

Typedefs

template<Space S>
using Emrys::DifferenceSpace = typename internal::DifferenceSpaceOf<S>::type
 The space that differences of values in S live in: the type of its difference(), or S itself if it has none, as a space written from scratch may not.
template<Space S, typename Scalar = double>
using Emrys::ValueVector
 A value in S as an Eigen column vector of Scalar: a mean, a sample, or a true state.
template<Space S, typename Scalar = double>
using Emrys::DifferenceVector = ValueVector<DifferenceSpace<S>, Scalar>
 A difference in S as an Eigen column vector of Scalar, the type of minus() and of the offset plus() takes: a residual, an estimation error, a step, or the variances on a covariance's diagonal.
template<Space Rows, Space Cols = Rows, typename Scalar = double>
using Emrys::DifferenceMatrix
 An Eigen matrix of Scalar over the differences of Rows and Cols: a covariance, with one space for both (DifferenceMatrix<State>), or a Jacobian, a gain, or a linear model's matrix, from Cols's differences to Rows's (DifferenceMatrix<Fix, State>).

Functions

template<Space S>
DifferenceSpace< S > Emrys::differenceSpace (S const &space)
template<Space S>
Eigen::Index Emrys::valueDimension (S const &space)
template<Space S>
Eigen::Index Emrys::differenceDimension (S const &space)
template<Space S, typename Derived>
void Emrys::normalizeValues (S const &space, Eigen::MatrixBase< Derived > const &block)
 Brings the values in block (rows are space's coordinates, columns samples) into canonical form, writing through the const reference as the space's normalize() does: for values that come from outside, such as a user's mean or a model's output.
template<Space S, typename Derived>
void Emrys::normalizeDifferences (S const &space, Eigen::MatrixBase< Derived > const &block)
 Brings the differences in block into canonical form: normalizeValues() in the difference space of space, for differences that come from outside.
template<FixedSizeSpace S, typename Derived>
requires Space<S>
void Emrys::normalizeValues (Eigen::MatrixBase< Derived > const &block)
 normalizeValues() in the fixed-size space S, given as a template argument: normalizeValues<State>(block).
template<FixedSizeSpace S, typename Derived>
requires Space<S>
void Emrys::normalizeDifferences (Eigen::MatrixBase< Derived > const &block)
 normalizeDifferences() in the fixed-size space S, given as a template argument: normalizeDifferences<State>(block).
template<typename Derived>
Eigen::MatrixBase< Derived > & Emrys::writable (Eigen::MatrixBase< Derived > const &block)
 block, writable: Eigen's idiom for a function that writes through an expression passed as const&.
template<Space S, typename XDerived, typename DDerived>
auto Emrys::plus (S const &space, Eigen::MatrixBase< XDerived > const &x, Eigen::MatrixBase< DDerived > const &d)
template<Space S, typename ADerived, typename BDerived>
auto Emrys::minus (S const &space, Eigen::MatrixBase< ADerived > const &a, Eigen::MatrixBase< BDerived > const &b)
template<Space S, typename XDerived, typename DDerived>
auto Emrys::less (S const &space, Eigen::MatrixBase< XDerived > const &x, Eigen::MatrixBase< DDerived > const &d)
template<FixedSizeSpace S, typename XDerived, typename DDerived>
requires Space<S>
auto Emrys::plus (Eigen::MatrixBase< XDerived > const &x, Eigen::MatrixBase< DDerived > const &d)
template<FixedSizeSpace S, typename ADerived, typename BDerived>
requires Space<S>
auto Emrys::minus (Eigen::MatrixBase< ADerived > const &a, Eigen::MatrixBase< BDerived > const &b)
template<FixedSizeSpace S, typename XDerived, typename DDerived>
requires Space<S>
auto Emrys::less (Eigen::MatrixBase< XDerived > const &x, Eigen::MatrixBase< DDerived > const &d)
template<typename Space>
constexpr bool Emrys::allowsValueDimension (Eigen::Index n)

Variables

template<typename Space>
constexpr int Emrys::valueDimensionAtCompileTime
 The value dimension of Space at compile time, or Eigen::Dynamic if it is resizable.
template<typename Space>
constexpr int Emrys::maxValueDimensionAtCompileTime
 The largest valid value dimension of Space, or Eigen::Dynamic if it is unbounded.
template<Space S>
constexpr bool Emrys::hasPlainValues = !internal::HasNormalize<S> && !internal::HasPlus<S>
 Whether the values of S are plain: it has neither normalize() nor plus(), so \( x \boxplus \delta \) is x + δ.
template<Space S>
constexpr bool Emrys::hasPlainDifferences
 Whether the differences of S are plain: its difference space has no normalize(), and it has neither plus() nor minus(), so \( a \boxminus b \) is a - b and \( x \boxplus \delta \) is x + δ up to normalize().
template<Space S>
constexpr bool Emrys::isLinear = hasPlainValues<S> && hasPlainDifferences<S>
 Whether S is linear: its values and its differences are both plain vectors.

Detailed Description

The Space concept and what every continuous space shares (decisions.md [sizes-and-dimensions]): the traits a space exposes, DifferenceSpace, valueDimension(), differenceDimension(), and allowsValueDimension(); ValueVector, DifferenceVector, and DifferenceMatrix, the Eigen types a space sizes; isLinear<> and its parts; writable(); and the free functions plus(), minus(), less(), normalizeValues(), and normalizeDifferences(), which add and subtract where a space has no plus() or minus() of its own [difference-spaces].

The page of the Spaces group, which starts here, describes the continuous spaces as a whole. Read Coordinates.h next, for the types that implement the concept, then Composite.h, TagPath.h, and Subspace.h.