rexlib
0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
rexlib
core
operation
type_rule
type_transform.hpp
1
// SPDX-License-Identifier: GPL-3.0-only
2
3
#pragma once
4
5
#include <rexlib/core/numerical/numerical_type.hpp>
6
#include <rexlib/core/numerical/numerical_type_domain.hpp>
7
8
#include <functional>
9
10
namespace
rexlib
11
{
12
21
class
type_transform
22
{
23
public
:
27
using
apply_function_type
=
numerical_type
(*)(
numerical_type
);
28
39
type_transform
(
40
apply_function_type
apply
,
41
const
numerical_type_domain
&
domain
,
42
const
char
*
relation
43
)
noexcept
;
44
51
numerical_type
apply
(
numerical_type
type)
const
noexcept
;
52
58
const
numerical_type_domain
&
get_domain
()
const
noexcept
;
59
65
const
char
*
get_relation
()
const
noexcept
;
66
67
private
:
68
apply_function_type
m_apply;
69
std::
reference_wrapper
<
const
numerical_type_domain
> m_domain;
70
const
char
*m_relation;
71
};
72
79
template
<
typename
Transform
>
80
type_transform
make_type_transform
()
noexcept
;
81
82
}
// namespace rexlib
83
84
#include "type_transform.inl"
rexlib::array
Container for multidimensional numeric data.
Definition
array.hpp:31
rexlib::numerical_type_domain
Set of numerical_type-s.
Definition
numerical_type_domain.hpp:32
rexlib::type_transform
Type erased form of a type transform.
Definition
type_transform.hpp:22
rexlib::type_transform::apply
numerical_type apply(numerical_type type) const noexcept
Apply the transform to a pivot type.
rexlib::type_transform::get_domain
const numerical_type_domain & get_domain() const noexcept
Get the set of pivot types the transform is defined on.
rexlib::type_transform::type_transform
type_transform(apply_function_type apply, const numerical_type_domain &domain, const char *relation) noexcept
Construct a type transform.
rexlib::type_transform::get_relation
const char * get_relation() const noexcept
Get the fragment naming the mapping.
rexlib
Arrays, the operations on them and the devices that run those operations.
Definition
cpu_device.hpp:10
rexlib::make_type_transform
type_transform make_type_transform() noexcept
Erase a type transform tag.
rexlib::numerical_type
numerical_type
Representation of all considered numerical types for computations.
Definition
numerical_type.hpp:19
Generated by
1.9.8