EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
Loading...
Searching...
No Matches
Emrys::DiscreteProduct< Axes > Class Template Reference

The product of the discrete spaces Axes: a value has one value in each axis. More...

#include <EmrysFilter/Spaces/Discrete.h>

Inheritance diagram for Emrys::DiscreteProduct< Axes >:

Public Member Functions

constexpr DiscreteProduct (Axes... axes)
 The product of axes, with their cardinalities.
template<std::size_t I>
constexpr auto const & axis () const
constexpr Eigen::Index cardinality () const
template<std::size_t I>
constexpr Eigen::Index stride () const
constexpr Eigen::Index value (std::array< Eigen::Index, AxisCount > const &coordinates) const
constexpr std::array< Eigen::Index, AxisCount > coordinates (Eigen::Index value) const

Static Public Attributes

static constexpr std::size_t AxisCount = sizeof...(Axes)
 the number of axes
static constexpr int Cardinality = internal::productCardinality<Axes::Cardinality...>()
 the product of the axes' cardinalities, or Eigen::Dynamic if any is
static constexpr int MaxCardinality = internal::productCardinality<Axes::MaxCardinality...>()
 the product of the axes' bounds, or Eigen::Dynamic if any is unbounded

Friends

bool operator== (DiscreteProduct const &, DiscreteProduct const &)=default
 Equal when every axis is.

Detailed Description

template<DiscreteSpace... Axes>
class Emrys::DiscreteProduct< Axes >

The product of the discrete spaces Axes: a value has one value in each axis.

Its cardinality is the product of theirs. Values are flattened with the last axis varying fastest: axis I has the stride stride<I>(), the product of the cardinalities after it, and a value's flat index is the sum of each axis's index times its stride.

Member Function Documentation

◆ axis()

template<DiscreteSpace... Axes>
template<std::size_t I>
auto const & Emrys::DiscreteProduct< Axes >::axis ( ) const
inlinenodiscardconstexpr
Returns
axis I

◆ cardinality()

template<DiscreteSpace... Axes>
Eigen::Index Emrys::DiscreteProduct< Axes >::cardinality ( ) const
inlinenodiscardconstexpr
Returns
the number of values: the product of the axes' cardinalities

◆ coordinates()

template<DiscreteSpace... Axes>
std::array< Eigen::Index, AxisCount > Emrys::DiscreteProduct< Axes >::coordinates ( Eigen::Index value) const
inlinenodiscardconstexpr
Returns
the index in each axis of the value with flat index value

◆ stride()

template<DiscreteSpace... Axes>
template<std::size_t I>
Eigen::Index Emrys::DiscreteProduct< Axes >::stride ( ) const
inlinenodiscardconstexpr
Returns
the stride of axis I: the product of the cardinalities of the axes after it

◆ value()

template<DiscreteSpace... Axes>
Eigen::Index Emrys::DiscreteProduct< Axes >::value ( std::array< Eigen::Index, AxisCount > const & coordinates) const
inlinenodiscardconstexpr
Returns
the flat index of the value with index coordinates[i] in axis i

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