rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
rexlib::extent_transform Class Reference

Type erased form of an extent transform. More...

#include <rexlib/core/operation/shape_rule/extent_transform.hpp>

Public Types

using apply_function_type = std::size_t(*)(std::size_t)
 The mapping of an extent.
 

Public Member Functions

 extent_transform (apply_function_type apply, const char *relation, bool identity) noexcept
 Construct an extent transform.
 
std::size_t apply (std::size_t extent) const noexcept
 Apply the transform to an extent.
 
const char * get_relation () const noexcept
 Get the fragment naming the mapping.
 
bool is_identity () const noexcept
 Check whether the transform is the identity.
 

Detailed Description

Type erased form of an extent transform.

Holds the mapping, the fragment naming it in diagnostics, and whether it is the identity.

See also
same_extent_transform

Constructor & Destructor Documentation

◆ extent_transform()

rexlib::extent_transform::extent_transform ( apply_function_type  apply,
const char *  relation,
bool  identity 
)
noexcept

Construct an extent transform.

Parameters
applyThe mapping. Must not be null.
relationFragment naming the mapping, for diagnostics. Must not be null and must outlive the transform.
identityWhether the mapping is the identity.

Member Function Documentation

◆ apply()

std::size_t rexlib::extent_transform::apply ( std::size_t  extent) const
noexcept

Apply the transform to an extent.

Parameters
extentThe extent of the variable.
Returns
std::size_t The extent of the axis.

◆ get_relation()

const char * rexlib::extent_transform::get_relation ( ) const
noexcept

Get the fragment naming the mapping.

Returns
const char* The fragment.

◆ is_identity()

bool rexlib::extent_transform::is_identity ( ) const
noexcept

Check whether the transform is the identity.

Returns
true The transform maps every extent onto itself.
false It does not.

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