rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
numerical_type.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include "../platform/constexpr.hpp"
6#include "../platform/dynamic_shared_object.h"
7
8#include <ostream>
9
10namespace rexlib
11{
12
19{
20 unknown = -1,
21
22 boolean,
23
24 char8,
25
26 int8,
27 uint8,
28 int16,
29 uint16,
30 int32,
31 uint32,
32 int64,
33 uint64,
34
35 float16,
36 float32,
37 float64,
38
39 complex_float16,
40 complex_float32,
41 complex_float64,
42
43 // Add here
44
45 count
46};
47
54{
55 unknown = -1,
56
57 boolean,
58 character,
59 signed_integer,
60 unsigned_integer,
61 floating_point,
62 complex,
63
64 // Add here
65
66 count
67};
68
75REXLIB_API
76std::size_t get_size(numerical_type type) noexcept;
77
89
103
122
138
151REXLIB_CONSTEXPR
153
155const char* to_string(numerical_type type) noexcept;
156
158const char* to_string(numerical_type_category category) noexcept;
159
161std::ostream& operator<<(std::ostream &os, numerical_type type);
162
164std::ostream& operator<<(std::ostream &os, numerical_type_category category);
165
166} // namespace rexlib
167
168#include "numerical_type.inl"
Container for multidimensional numeric data.
Definition array.hpp:31
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
numerical_type make_real(numerical_type type) noexcept
Get the real equivalent of a numerical type.
numerical_type make_inexact(numerical_type type) noexcept
Get the inexact equivalent of a numerical type.
REXLIB_CONSTEXPR numerical_type_category get_category(numerical_type type) noexcept
Get the category of the provided numerical type.
numerical_type make_complex(numerical_type type) noexcept
Create a complex version, if exists.
numerical_type
Representation of all considered numerical types for computations.
Definition numerical_type.hpp:19
numerical_type_category
Broad categorical classification of numerical_type.
Definition numerical_type.hpp:54
std::size_t get_size(numerical_type type) noexcept
Get the size of a numerical type.
numerical_type promote_types(numerical_type type1, numerical_type type2) noexcept
Get the common type of two numerical types.