rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
extent_transform.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include <cstddef>
6
7namespace rexlib
8{
9
19{
20public:
24 using apply_function_type = std::size_t (*)(std::size_t);
25
36 const char *relation,
37 bool identity
38 ) noexcept;
39
46 std::size_t apply(std::size_t extent) const noexcept;
47
54
62
64 apply_function_type m_apply;
65 const char *m_relation;
66 bool m_identity;
67};
68
77
78} // namespace rexlib
79
80#include "extent_transform.inl"
Container for multidimensional numeric data.
Definition array.hpp:31
Type erased form of an extent transform.
Definition extent_transform.hpp:19
std::size_t apply(std::size_t extent) const noexcept
Apply the transform to an extent.
std::size_t(*)(std::size_t) apply_function_type
The mapping of an extent.
Definition extent_transform.hpp:24
const char * get_relation() const noexcept
Get the fragment naming the mapping.
extent_transform(apply_function_type apply, const char *relation, bool identity) noexcept
Construct an extent transform.
bool is_identity() const noexcept
Check whether the transform is the identity.
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
extent_transform make_extent_transform() noexcept
Erase an extent transform tag.