xcoordinate_expanded

Defined in xframe/xcoordinate_expanded.hpp

template<class C>
class xcoordinate_expanded

view of an xcoordinate which expands the xcoordinate dimensions

The xcoordinate_expanded is used for modeling an expanded view on an existing xcoordinate, i.e. a superset of this xcoordinate. This is done by holding an extra coordinate map and keeping a reference to the underlying xcoordinate.

See

xcoordinate

See

xcoordinate_chain

Template Parameters
  • C: the type of the underlying xcoordinate.

Public Functions

xcoordinate_expanded(const coordinate_type &sub_coord, const map_type &new_coord)

Constructs an xcoordinate_expanded, given the reference to an xcoordinate and the reference to the additional dimension mapping.

Parameters
  • sub_coord: the reference to the underlying xcoordinate.

  • new_coord: the dimension name <-> axis mapping of the additional coordinates.

xcoordinate_expanded(const coordinate_type &sub_coord, map_type &&new_coord)

Constructs an xcoordinate_expanded, given the reference to an xcoordinate and the reference to the additional dimension mapping.

Parameters
  • sub_coord: the reference to the underlying xcoordinate.

  • new_coord: the dimension name <-> axis mapping of the additional coordinates.

bool empty() const

Returns true if the coordinates is empty, i.e.

it contains no mapping of axes with dimension names.

auto size() const

Returns the number of axes in the coordinates.

bool contains(const key_type &key) const

Returns true if the coordinates contains the specified dimension name.

Parameters
  • key: the dimension name to search for.

bool contains(const key_type &key, const label_type &label) const

Returns true if the coordinates contains the specified dimension name and if the axis mapped with this name contains the specified label.

Parameters
  • key: the dimension name to search for.

  • label: the label to search for in the mapped axis.

auto operator[](const key_type &key) const

Returns the axis mapped to the specified dimension name.

If this last one is not found, throws an exception.

Parameters
  • key: the name of the dimension to search for.

auto find(const key_type &key) const

Returns a constant iterator to the axis mapped to the specified dimension name.

If no such element is found, past-the-end iterator is returned.

Parameters
  • key: the dimension name to search for.

auto begin() const

Returns a constant iterator to the first element of the coordinates.

Such an element is a pair dimension name - axis.

auto end() const

Returns a constant iterator to the element following the last element of the coordinates.

auto cbegin() const

Returns a constant iterator to the first element of the coordinates.

Such an element is a pair dimension name - axis.

auto cend() const

Returns a constant iterator to the element following the last element of the coordinates.

auto key_begin() const

Returns a constant iterator to the first dimension name of the coordinates.

auto key_end() const

Returns a constant iterator to the element following the last dimension name of the coordinates.

template<class KB, class LB>
auto operator[](const std::pair<KB, LB> &key) const

Returns the position of the specified labels of the axis mapped to the specified dimension name.

Throws an exception if either the dimension name or the label is not part of this coordinate.

Parameters
  • key: the pair dimension name - label to search for.

template<class C>
xcoordinate_expanded<C> xf::expand_dims(const C &coordinate, const typename C::map_type &new_coord)

Expand the dimensions of an xcoordinate, given the reference to an xcoordinate and the reference to the additional dimension mapping.

Parameters
  • sub_coord: the reference to the underlying xcoordinate.

  • new_coord: the dimension name <-> axis mapping of the additional coordinates.

template<class C>
xcoordinate_expanded<C> xf::expand_dims(const C &coordinate, typename C::map_type &&new_coord)

Expand the dimensions of an xcoordinate, given the reference to an xcoordinate and the reference to the additional dimension mapping.

Parameters
  • sub_coord: the reference to the underlying xcoordinate.

  • new_coord: the dimension name <-> axis mapping of the additional coordinates.