vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
vitrio::image_transfer_shape Class Reference

The shape every region of a transfer shares: the extents of one region and the ranks of the file and the array it joins. More...

#include <vitrio/image_transfer_shape.hpp>

Public Member Functions

 image_transfer_shape (std::vector< std::size_t > extents, std::size_t file_rank, std::size_t array_rank)
 Construct a shape from its components.
 
 image_transfer_shape (const image_transfer_shape &other)
 
 image_transfer_shape (image_transfer_shape &&other) noexcept
 
image_transfer_shape & operator= (const image_transfer_shape &other)
 
image_transfer_shape & operator= (image_transfer_shape &&other) noexcept
 
span< const std::size_t > get_extents () const noexcept
 Get the extents of one region.
 
std::size_t get_rank () const noexcept
 Get the rank of one region.
 
std::size_t get_file_rank () const noexcept
 Get the rank of the file side.
 
std::size_t get_array_rank () const noexcept
 Get the rank of the array side.
 
std::size_t get_leading_rank (std::size_t rank) const noexcept
 Get how many leading axes of a side a region spans a single position along.
 
std::size_t get_extent (std::size_t rank, std::size_t axis) const noexcept
 Get the extent a region spans along one axis of a side.
 

Detailed Description

The shape every region of a transfer shares: the extents of one region and the ranks of the file and the array it joins.

The extents are the shape of one region and nothing else, so they carry the rank of the region rather than the rank of either side. A side of higher rank spans a single position along the axes the extents do not reach, which are its implicit leading ones, and neither side pads the extents. For example, two dimensional regions of a two dimensional file placed side by side along the first axis of a three dimensional array have extents of rank two, a file rank of two and an array rank of three. Ranks may differ in either direction, so a plane of a three dimensional file may equally go to a two dimensional array.

See also
image_transfer_plan
image_transaction_plan

Constructor & Destructor Documentation

◆ image_transfer_shape()

vitrio::image_transfer_shape::image_transfer_shape ( std::vector< std::size_t >  extents,
std::size_t  file_rank,
std::size_t  array_rank 
)

Construct a shape from its components.

Parameters
extentsExtents of one region. Their rank is the rank of the region, which may be lower than that of either side.
file_rankRank of the file side.
array_rankRank of the array side.
Exceptions
std::invalid_argumentIf the rank of extents exceeds file_rank or array_rank.

Member Function Documentation

◆ get_array_rank()

std::size_t vitrio::image_transfer_shape::get_array_rank ( ) const
noexcept

Get the rank of the array side.

Returns
std::size_t The rank, never below get_rank.

◆ get_extent()

std::size_t vitrio::image_transfer_shape::get_extent ( std::size_t  rank,
std::size_t  axis 
) const
noexcept

Get the extent a region spans along one axis of a side.

Parameters
rankRank of the side. Must not be below get_rank.
axisIndex of the axis, below rank.
Returns
std::size_t One along a leading axis, and the extent the axis corresponds to otherwise.

◆ get_extents()

span< const std::size_t > vitrio::image_transfer_shape::get_extents ( ) const
noexcept

Get the extents of one region.

Returns
span<const std::size_t> The extents, of rank get_rank. It refers to storage owned by this shape.

◆ get_file_rank()

std::size_t vitrio::image_transfer_shape::get_file_rank ( ) const
noexcept

Get the rank of the file side.

Returns
std::size_t The rank, never below get_rank.

◆ get_leading_rank()

std::size_t vitrio::image_transfer_shape::get_leading_rank ( std::size_t  rank) const
noexcept

Get how many leading axes of a side a region spans a single position along.

Parameters
rankRank of the side. Must not be below get_rank.
Returns
std::size_t The number of axes the extents do not reach.

◆ get_rank()

std::size_t vitrio::image_transfer_shape::get_rank ( ) const
noexcept

Get the rank of one region.

Returns
std::size_t The rank of the extents.

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