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
inexact_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_tags.hpp>
7
#include <rexlib/core/numerical/numerical_type_traits.hpp>
8
9
#include <complex>
10
11
namespace
rexlib
12
{
13
26
struct
inexact_type_transform
27
{
28
using
domain_type
=
domain_union
<
29
boolean_type_domain
,
30
arithmetic_type_domain
31
>;
32
38
static
const
char
*
get_relation
()
noexcept
;
39
46
static
numerical_type
apply
(
numerical_type
type)
noexcept
;
47
53
template
<
typename
T
>
54
struct
apply_type
55
{
56
using
type
=
float64_t
;
57
};
58
59
template
<
typename
T>
60
struct
apply_type
<std::complex<T>>
61
{
62
using
type = std::complex<T>;
63
};
64
};
65
66
template
<>
67
struct
inexact_type_transform::apply_type
<
float16_t
>
68
{
69
using
type
=
float16_t
;
70
};
71
72
template
<>
73
struct
inexact_type_transform::apply_type
<
float32_t
>
74
{
75
using
type
=
float32_t
;
76
};
77
78
template
<>
79
struct
inexact_type_transform::apply_type
<
float64_t
>
80
{
81
using
type
=
float64_t
;
82
};
83
84
}
// namespace rexlib
85
86
#include "inexact_type_transform.inl"
rexlib::array
Container for multidimensional numeric data.
Definition
array.hpp:31
rexlib::float16_t
16 bit floating point number representation.
Definition
fixed_width_float.hpp:22
rexlib
Arrays, the operations on them and the devices that run those operations.
Definition
cpu_device.hpp:10
rexlib::numerical_type
numerical_type
Representation of all considered numerical types for computations.
Definition
numerical_type.hpp:19
rexlib::float64_t
double float64_t
64 bit floating point number representation.
Definition
fixed_width_float.hpp:56
rexlib::float32_t
float float32_t
32 bit floating point number representation.
Definition
fixed_width_float.hpp:50
rexlib::domain_union
Named domain holding the union of other named domains.
Definition
numerical_type_domain_tags.hpp:142
rexlib::inexact_type_transform::apply_type
Apply the transform to a native pivot type.
Definition
inexact_type_transform.hpp:55
rexlib::inexact_type_transform
Transform mapping a pivot type onto its inexact counterpart.
Definition
inexact_type_transform.hpp:27
rexlib::inexact_type_transform::get_relation
static const char * get_relation() noexcept
Get a fragment naming the mapping, for diagnostics.
rexlib::inexact_type_transform::apply
static numerical_type apply(numerical_type type) noexcept
Apply the transform to a pivot type.
Generated by
1.9.8