xcoordinate

Defined in xframe/xcoordinate.hpp

template<class K, class L = xtl::mpl::vector<int, std::size_t, char, xf::fstring>, class S = std::size_t, class MT = hash_map_tag>
class xcoordinate : public xf::xcoordinate_base<K, xaxis_variant<L, S, MT>>

Class modeling coordinates.

The xcoordinate class is used for modeling coordinates. Coordinates are mapping of dimension names to axes. Axes in a xcoordinate object can have different label types.

Template Parameters
  • K: the type of dimension names.

  • L: the type list of axes labels.

  • S: the integer type used to represent positions in axes. Default value is std::size_t.

  • MT: the tag used for choosing the map type which holds the label- position pairs in the axes. Possible values are map_tag and hash_map_tag. Default value is hash_map_tag.

Public Functions

xcoordinate(const map_type &axes)

Constructs an xcoordinate object with the given mapping of dimension names to axes.

This mapping is copied.

Parameters
  • axes: the dimension names to axes mapping.

xcoordinate(map_type &&axes)

Constructs an xcoordinate object with the given mapping of dimension names to axes.

This mapping is moved and therefore it is invalid after the xcoordinate has been constructed.

Parameters
  • axes: the dimension names to axes mapping.

xcoordinate(std::initializer_list<value_type> init)

Constructs an xcoordinate object from the given initializer list of dimension names - axes pairs.

template<class ...K1, class ...LT>
xcoordinate(xnamed_axis<K1, S, MT, L, LT>... axes)

Constructs an xcoordinate object from the given named axes.

void clear()

Removes all the elements from the xcoordinate.

After this call, size() returns zero.

template<class Join, class ...Args>
xtrivial_broadcast broadcast(const Args&... coordinates)

Broadcast the specified coordinates to this xcoordinate.

Return

an object specifying if the labels and the dimension of the coordinates are the same.

Parameters
  • coordinates: the coordinates to broadcast.

template<class K = fstring, class L = xtl::mpl::vector<int, std::size_t, char, xf::fstring>, class S = std::size_t, class MT = hash_map_tag>
xcoordinate<K, L, S, MT> xf::coordinate(const std::map<K, xaxis_variant<L, S, MT>> &axes)

Builds and returns an xcoordinate object from the specified mapping of dimension names to axes.

The map is copied.

Parameters
  • axes: the dimension names to axes mapping.

template<class K = fstring, class L = xtl::mpl::vector<int, std::size_t, char, xf::fstring>, class S = std::size_t, class MT = hash_map_tag>
xcoordinate<K, L, S, MT> xf::coordinate(std::map<K, xaxis_variant<L, S, MT>> &&axes)

Builds and returns an xcoordinate object from the specified mapping of dimension names to axes.

The map is moved, therefore it is invalid after the xcoordinate object has been built.

Parameters
  • axes: the dimension names to axes mapping.

template<class K, class ...K1, class S, class MT, class L, class LT, class ...LT1>
xcoordinate<K, L, S, MT> xf::coordinate(xnamed_axis<K, S, MT, L, LT> axis, xnamed_axis<K1, S, MT, L, LT1>... axes)

Builds and returns an xcoordinate object from the specified list of named axes.

Parameters
  • axes: the list of named axes.

template<class Join, class K, class L, class S, class MT, class ...Args>
xtrivial_broadcast xf::broadcast_coordinates(xcoordinate<K, L, S, MT> &output, const Args&... coordinates)

Broadcast a list of coordinates to the specified output coordinate.

Parameters
  • output: the xcoordinate result.

  • coordinates: the list of xcoordinate objects to broadcast.