OpenKalman
Namespaces | Classes | Typedefs | Functions | Variables
OpenKalman::coordinates Namespace Reference

The namespace for features relating to coordinates::pattern object. More...

Namespaces

 angle
 Namespace for definitions relating to specialized instances of Angle.
 
 inclination
 Namespace for definitions relating to specialized instances of Inclination.
 
 views
 The namespace for views for coordinates::pattern object.
 

Classes

struct  Angle
 An angle or any other simple modular value. More...
 
struct  Any
 
struct  common_descriptor_type
 The common type within a pattern, if it exists. More...
 
struct  common_descriptor_type< T, std::enable_if_t< descriptor< T > > >
 
struct  common_descriptor_type< T, std::enable_if_t< descriptor_collection< T > > >
 
struct  dimension_of
 The size of a coordinates::pattern. More...
 
struct  dimension_of< T, std::void_t< decltype(get_dimension(std::declval< T >()))> >
 
struct  Dimensions
 A structure representing the dimensions associated with of a particular index. More...
 
struct  Dimensions< stdex::dynamic_extent >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
struct  dimensions_tuple_view
 A view to the dimensions of a uniformly_gettable pattern_collection. More...
 
struct  Distance
 A non-negative real or integral number, [0,∞], representing a distance. More...
 
struct  Inclination
 A non-negative real number φ representing an inclination (angle from the positive z axis). More...
 
struct  Polar
 An atomic coordinates::descriptor reflecting polar coordinates. More...
 
struct  Spherical
 A coordinates::descriptor reflecting spherical coordinates according to the ISO 80000-2:2019 convention. More...
 
struct  stat_dimension_of
 The dimension size of a set of coordinates::pattern if it is transformed into Euclidean space. More...
 
struct  stat_dimension_of< T, std::enable_if_t< values::index< decltype(coordinates::get_stat_dimension(std::declval< T >()))> > >
 
struct  uniform_pattern_type
 If T is a uniform_pattern, type is an alias for the uniform component. More...
 
struct  uniform_pattern_type< T, std::enable_if_t< pattern< T > and(euclidean_pattern< T > or detail::common_descriptor_dimension_is_1< T >::value)> >
 

Typedefs

using Axis = Dimensions< 1 >
 Alias for a 1D Euclidean coordinates::pattern object.
 
template<typename T >
using common_descriptor_type_t = typename common_descriptor_type< T >::type
 Helper template for common_descriptor_type.
 
template<typename T >
using uniform_pattern_type_t = typename uniform_pattern_type< T >::type
 Helper template for uniform_pattern_type.
 

Functions

template<typename D , std::enable_if_t< fixed_pattern< D > and euclidean_pattern< D >, int > = 0>
 Dimensions (D &&) -> Dimensions< dimension_of< D >::value >
 
 Dimensions (const std::size_t &) -> Dimensions< stdex::dynamic_extent >
 
template<auto comp = &stdex::is_eq, typename A , typename B , std::enable_if_t< pattern< A > and pattern< B > and std::is_invocable_r_v< bool, decltype(comp), stdex::partial_ordering >, int > = 0>
constexpr auto compare (const A &a, const B &b)
 Compare two coordinates::pattern objects lexicographically. More...
 
template<auto comp = &stdex::is_eq, typename A , typename B , std::enable_if_t< pattern_collection< A > and pattern_collection< B > and std::is_invocable_r_v< bool, decltype(comp), stdex::partial_ordering >, int > = 0>
constexpr auto compare_pattern_collections (const A &a, const B &b)
 Compare each element of two pattern_collection objects lexicographically. More...
 
template<typename A , typename B , typename Comparison = stdex::compare_three_way, std::enable_if_t< pattern< A > and pattern< B > and std::is_invocable_r< stdex::partial_ordering, Comparison, std::size_t, std::size_t >::value, int > = 0>
constexpr auto compare_three_way (A &&a, B &&b, const Comparison &c={})
 Compare two coordinates::pattern objects lexicographically. More...
 
template<typename T , typename R , std::enable_if_t< descriptor< T > and collections::collection< R >, int > = 0>
decltype(auto) constexpr from_stat_space (const T &t, R &&stat_data_view)
 Maps a range in a vector space for directional-statistics back to a range reflecting vector-space data. More...
 
template<typename Arg , std::enable_if_t< pattern< Arg > and(descriptor< Arg > or collections::sized< Arg >), int > = 0>
constexpr auto get_dimension (const Arg &arg)
 Get the vector dimension of coordinates::pattern Arg.
 
template<typename Arg , std::enable_if_t< pattern< Arg > and(descriptor< Arg > or collections::sized< Arg > or detail::is_unbound_fixed_range< Arg >::value), int > = 0>
constexpr auto get_is_euclidean (const Arg &arg)
 Determine, whether coordinates::pattern Arg is euclidean.
 
template<typename Arg , std::enable_if_t< descriptor< Arg > or(descriptor_collection< Arg > and(collections::sized< Arg > or detail::range_value_has_fixed_stat_dimension< Arg >::value)), int > = 0>
constexpr auto get_stat_dimension (const Arg &arg)
 Get the vector dimension of coordinates::pattern Arg when transformed into statistical space. More...
 
template<typename T , std::enable_if_t< pattern< T >, int > = 0>
constexpr auto get_uniform_pattern_component (T &&t)
 If the argument is a uniform pattern, return the 1D component that can be replicated to produce the argument. More...
 
template<typename A , typename B , std::enable_if_t< pattern< A > and pattern< B >, int > = 0>
constexpr auto is_uniform_pattern_component_of (const A &a, const B &b)
 
template<typename... Args, std::enable_if_t<(... and descriptor< Args >), int > = 0>
constexpr auto make_descriptor_range (Args &&...args)
 Make a descriptor_collection from a list of descriptors. More...
 
template<typename T , typename R , std::enable_if_t< descriptor< T > and collections::collection< R >, int > = 0>
decltype(auto) constexpr to_stat_space (const T &t, R &&data_view)
 Maps a range reflecting vector-space data to a corresponding range in a vector space for directional statistics. More...
 
template<typename T , typename R , std::enable_if_t< descriptor< T > and collections::collection< R >, int > = 0>
decltype(auto) constexpr wrap (const T &t, R &&data_view)
 wraps a range reflecting vector-space data to its primary range. More...
 

Variables

template<typename T , typename U , auto comp = &stdex::is_eq, applicability a = applicability::guaranteed>
constexpr bool compares_with
 Compares two coordinates::pattern objects. More...
 
template<typename T >
constexpr bool descriptor
 T is an atomic (non-separable or non-composite) grouping of coordinates::pattern objects. More...
 
template<typename T >
constexpr bool descriptor_collection
 An object describing a collection of /ref coordinates::descriptor objects. More...
 
template<typename T >
constexpr bool dynamic_pattern
 A coordinates::pattern for which the size is defined at runtime. More...
 
template<typename T >
constexpr bool euclidean_pattern = detail::euclidean_pattern_impl<T>::value
 A coordinates::pattern for a normal Euclidean vector.
 
template<typename T >
constexpr bool euclidean_pattern_collection
 An object describing a collection of /ref euclidean_pattern objects. More...
 
template<typename T >
constexpr bool fixed_pattern
 A coordinates::pattern for which the dimension is fixed at compile time. More...
 
template<typename T >
constexpr bool fixed_pattern_collection
 An object describing a fixed-size collection of /ref fixed_pattern objects. More...
 
template<typename T >
constexpr bool pattern
 An object describing the set of coordinates associated with a tensor index. More...
 
template<typename T >
constexpr bool pattern_collection
 An object describing a collection of /ref pattern objects. More...
 
template<typename T , typename U , auto comp = &stdex::is_eq, applicability a = applicability::guaranteed>
constexpr bool pattern_collection_compares_with
 Compares a two coordinates::pattern_collection objects. More...
 
template<typename T , applicability a = applicability::guaranteed>
constexpr bool uniform_pattern
 T is a coordinates::pattern that is either empty or can be decomposed into a uniform set of 1D coordinates::pattern. More...
 
template<typename T >
constexpr auto dimension_of_v = dimension_of<T>::value
 Helper template for coordinates::dimension_of.
 
template<typename T >
constexpr auto stat_dimension_of_v = stat_dimension_of<T>::value
 Helper template for coordinates::stat_dimension_of.
 

Detailed Description

The namespace for features relating to coordinates::pattern object.

Function Documentation

◆ compare()

template<auto comp = &stdex::is_eq, typename A , typename B , std::enable_if_t< pattern< A > and pattern< B > and std::is_invocable_r_v< bool, decltype(comp), stdex::partial_ordering >, int > = 0>
constexpr auto OpenKalman::coordinates::compare ( const A &  a,
const B &  b 
)

Compare two coordinates::pattern objects lexicographically.

Consecutive euclidean_pattern arguments are consolidated before the comparison occurs.

Template Parameters
compA callable object taking the comparison result (e.g., std::partial_ordering) and returning a bool value

◆ compare_pattern_collections()

template<auto comp = &stdex::is_eq, typename A , typename B , std::enable_if_t< pattern_collection< A > and pattern_collection< B > and std::is_invocable_r_v< bool, decltype(comp), stdex::partial_ordering >, int > = 0>
constexpr auto OpenKalman::coordinates::compare_pattern_collections ( const A &  a,
const B &  b 
)

Compare each element of two pattern_collection objects lexicographically.

Performs a compare operation on each element of the collection. If the patterns are different sizes, trailing Dimensions<1> patterns are added to the smaller one before the comparison.

Template Parameters
compA callable object taking the comparison result (e.g., std::partial_ordering) and returning a bool value

◆ compare_three_way()

template<typename A , typename B , typename Comparison = stdex::compare_three_way, std::enable_if_t< pattern< A > and pattern< B > and std::is_invocable_r< stdex::partial_ordering, Comparison, std::size_t, std::size_t >::value, int > = 0>
constexpr auto OpenKalman::coordinates::compare_three_way ( A &&  a,
B &&  b,
const Comparison &  c = {} 
)

Compare two coordinates::pattern objects lexicographically.

Consecutive euclidean_pattern arguments are consolidated before the comparison occurs.

Template Parameters
ComparisonA callable comparison function compatible with std::partial_ordering, such as std::compare_three_way

◆ from_stat_space()

template<typename T , typename R , std::enable_if_t< descriptor< T > and collections::collection< R >, int > = 0>
decltype(auto) constexpr OpenKalman::coordinates::from_stat_space ( const T &  t,
R &&  stat_data_view 
)

Maps a range in a vector space for directional-statistics back to a range reflecting vector-space data.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This is the inverse of to_stat_space.

Parameters
tA descriptor.
stat_data_viewA range within a data object corresponding to descriptor t.

Maps a range in a vector space for directional-statistics back to a range reflecting vector-space data.

This is the inverse of to_stat_space.

Parameters
tA descriptor_collection.
stat_data_viewA range within a data object corresponding to coordinates::descriptor_collection "descriptor_collection" t

◆ get_stat_dimension()

template<typename Arg , std::enable_if_t< descriptor< Arg > or(descriptor_collection< Arg > and(collections::sized< Arg > or detail::range_value_has_fixed_stat_dimension< Arg >::value)), int > = 0>
constexpr auto OpenKalman::coordinates::get_stat_dimension ( const Arg &  arg)

Get the vector dimension of coordinates::pattern Arg when transformed into statistical space.

This is the dimension of a vector corresponding to Arg that has been transformed to Euclidan space for directional statistics.

◆ get_uniform_pattern_component()

template<typename T , std::enable_if_t< pattern< T >, int > = 0>
constexpr auto OpenKalman::coordinates::get_uniform_pattern_component ( T &&  t)

If the argument is a uniform pattern, return the 1D component that can be replicated to produce the argument.

The result will equal the argument if replicated some number of times (including zero times).

Returns
An std::optional object containing the 1D component, if it exists.

◆ make_descriptor_range()

template<typename... Args, std::enable_if_t<(... and descriptor< Args >), int > = 0>
constexpr auto OpenKalman::coordinates::make_descriptor_range ( Args &&...  args)

Make a descriptor_collection from a list of descriptors.

The result will be a std::ranges::random_access_range<T>. To create a tuple-like structure instead, you should construct a std::tuple.

◆ to_stat_space()

template<typename T , typename R , std::enable_if_t< descriptor< T > and collections::collection< R >, int > = 0>
decltype(auto) constexpr OpenKalman::coordinates::to_stat_space ( const T &  t,
R &&  data_view 
)

Maps a range reflecting vector-space data to a corresponding range in a vector space for directional statistics.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This is the inverse of from_stat_space.

Parameters
tA descriptor.
data_viewA range within a data object corresponding to descriptor t.

Maps a range reflecting vector-space data to a corresponding range in a vector space for directional statistics.

This is the inverse of from_stat_space.

Parameters
tA descriptor_collection.
data_viewA range within a data object corresponding to descriptor_collection t

◆ wrap()

template<typename T , typename R , std::enable_if_t< descriptor< T > and collections::collection< R >, int > = 0>
decltype(auto) constexpr OpenKalman::coordinates::wrap ( const T &  t,
R &&  data_view 
)

wraps a range reflecting vector-space data to its primary range.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

The wrapping operation is equivalent to mapping from modular space to Euclidean space and then back again, or in other words, performing to_stat_space followed by from_stat_space.

Parameters
tA descriptor.
data_viewA range within a data object corresponding to descriptor t.

wraps a range reflecting vector-space data to its primary range.

The wrapping operation is equivalent to mapping from modular space to Euclidean space and then back again, or in other words, performing to_stat_space followed by from_stat_space.

Parameters
tA descriptor_collection.
data_viewA range within a data object corresponding to descriptor_collection t.

Variable Documentation

◆ compares_with

template<typename T , typename U , auto comp = &stdex::is_eq, applicability a = applicability::guaranteed>
constexpr bool OpenKalman::coordinates::compares_with
Initial value:
=
pattern<T> and pattern<U> and
std::is_invocable_r_v<bool, decltype(comp), stdex::partial_ordering> and
detail::compares_with_impl<T, U, comp, a>()

Compares two coordinates::pattern objects.

Every coordinate_list in the set must be potentially equivalent to every other coordinate_list in the set. Sets of vector space descriptors are equivalent if they are treated functionally the same.

  • Any coordinate_list is equivalent to itself.
  • std::tuple<As...> is equivalent to std::tuple<Bs...>, if each As is equivalent to its respective Bs.
  • std::tuple<A> is equivalent to A, and vice versa.
  • Dynamic coordinates::euclidean_pattern objects are equivalent to any other coordinates::euclidean_pattern,
    Examples:
    compares_with<std::tuple<Axis, Direction>, std::tuple<Axis, Direction>> compares_with<std::tuple<Axis, Direction>, std::tuple<Axis, Direction, angle::Radians>, less_than<>, applicability::guaranteed> compares_with<std::tuple<Axis, Direction>, std::tuple<Dimensions<>, Direction, angle::Radians>, less_than<>, applicability::permitted>
    Template Parameters
    compA callable object taking the comparison result (e.g., std::partial_ordering) and returning a bool value

◆ descriptor

template<typename T >
constexpr bool OpenKalman::coordinates::descriptor
Initial value:
=
interface::coordinate_descriptor_traits<std::decay_t<stdex::unwrap_ref_decay_t<T>>>::is_specialized or
values::index<T>

T is an atomic (non-separable or non-composite) grouping of coordinates::pattern objects.

◆ descriptor_collection

template<typename T >
constexpr bool OpenKalman::coordinates::descriptor_collection
Initial value:
=
detail::descriptor_range<T> or
detail::descriptor_tuple<T>

An object describing a collection of /ref coordinates::descriptor objects.

This can be either a uniformly_gettable structure or a std::ranges::random_access_range.

◆ dynamic_pattern

template<typename T >
constexpr bool OpenKalman::coordinates::dynamic_pattern
inline
Initial value:
=
pattern<T> and (not fixed_pattern<T>)

A coordinates::pattern for which the size is defined at runtime.

◆ euclidean_pattern_collection

template<typename T >
constexpr bool OpenKalman::coordinates::euclidean_pattern_collection
Initial value:
=
collections::collection<T> and
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45

An object describing a collection of /ref euclidean_pattern objects.

◆ fixed_pattern

template<typename T >
constexpr bool OpenKalman::coordinates::fixed_pattern
Initial value:
=
pattern<T> and
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45

A coordinates::pattern for which the dimension is fixed at compile time.

◆ fixed_pattern_collection

template<typename T >
constexpr bool OpenKalman::coordinates::fixed_pattern_collection
Initial value:
=
collections::collection<T> and
values::fixed_value_compares_with<collections::size_of<T>, stdex::dynamic_extent, &stdex::is_neq> and
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45

An object describing a fixed-size collection of /ref fixed_pattern objects.

◆ pattern

template<typename T >
constexpr bool OpenKalman::coordinates::pattern
inline
Initial value:
=
descriptor<T> or descriptor_collection<T>

An object describing the set of coordinates associated with a tensor index.

◆ pattern_collection

template<typename T >
constexpr bool OpenKalman::coordinates::pattern_collection
Initial value:
=
collections::collection<T> and
( (stdex::ranges::random_access_range<T> and detail::is_pattern_range<T>::value) or
)
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45

An object describing a collection of /ref pattern objects.

◆ pattern_collection_compares_with

template<typename T , typename U , auto comp = &stdex::is_eq, applicability a = applicability::guaranteed>
constexpr bool OpenKalman::coordinates::pattern_collection_compares_with
Initial value:
=
pattern_collection<T> and pattern_collection<U> and
std::is_invocable_r_v<bool, decltype(comp), stdex::partial_ordering> and
detail::pattern_collection_compares_with_impl<T, U, comp, a>()

Compares a two coordinates::pattern_collection objects.

Every coordinate_list in the set must be potentially equivalent to every other coordinate_list in the set. Trailing 1D patterns are ignored.

Template Parameters
compA consteval-callable object taking the comparison result (e.g., std::partial_ordering) and returning a bool value

◆ uniform_pattern

template<typename T , applicability a = applicability::guaranteed>
constexpr bool OpenKalman::coordinates::uniform_pattern
Initial value:
=
(a == applicability::guaranteed and detail::is_uniform_pattern_impl<T>::value) or
(a == applicability::permitted and not detail::heterogeneous_pattern<T>::value)
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45

T is a coordinates::pattern that is either empty or can be decomposed into a uniform set of 1D coordinates::pattern.

If T is a uniform pattern, uniform_pattern_type<T>::type will exist and will be one-dimensional.