eckit::HyperCube class

Helper class to handle multi-dimension objects

Public types

using Dimensions = std::vector<Ordinal>
using Coordinates = std::vector<Ordinal>
using Remapping = std::vector<Ordinal>

Public static functions

static void combine(Remapping&, const Remapping&)
Combines two 'remapping' vectors.

Constructors, destructors, conversion operators

HyperCube(const Dimensions& d) explicit

Public functions

auto index(const Coordinates&) const -> Ordinal
Translate coordinates into an index to a 1 dimension array.
auto count() const -> Ordinal
Method is inlined for speed.
void coordinates(Ordinal index, Coordinates&) const
Translate index to coordinates.
auto dimensions() const -> const Dimensions&
auto dimensions() -> Dimensions&
auto dimensions(Ordinal n) const -> Ordinal
auto size() const -> Ordinal
auto addToDimension(Ordinal which, Ordinal where, Ordinal count, Remapping&) const -> HyperCube

Function documentation

static void eckit::HyperCube::combine(Remapping&, const Remapping&)

Combines two 'remapping' vectors.

Method is inlined for speed.

Ordinal eckit::HyperCube::index(const Coordinates&) const

Translate coordinates into an index to a 1 dimension array.

Method is inlined for speed.

Ordinal eckit::HyperCube::count() const

Method is inlined for speed.

Returns the number of elemets

HyperCube eckit::HyperCube::addToDimension(Ordinal which, Ordinal where, Ordinal count, Remapping&) const

Returns the 'remapping' std::vector needing to add 'count' labels for the dimension 'which' at position 'where'
This website is beyond its original expiry date and the content may be out of date. The site owner has been notified and may choose to extend the expiry date and remove this banner. If you have any questions about this, please visit our support portal.