rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
operand_specification.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include <rexlib/core/ndarray/array_descriptor.hpp>
6#include <rexlib/core/numerical/numerical_type.hpp>
7#include <rexlib/core/platform/dynamic_shared_object.h>
8
9#include <cstddef>
10#include <vector>
11
12namespace rexlib
13{
14
24{
25public:
26 using shape_type = std::vector<std::size_t>;
27
33
42 shape_type shape,
44 ) noexcept;
45
49
54
62
69 void set_shape(shape_type shape) noexcept;
70
78
86
97 );
98
99 friend bool operator==(
102 ) noexcept
103 {
104 return
105 lhs.get_shape() == rhs.get_shape() &&
106 lhs.get_data_type() == rhs.get_data_type();
107 }
108
109 friend bool operator!=(
112 ) noexcept
113 {
114 return !(lhs == rhs);
115 }
116
117private:
118 shape_type m_shape;
119 numerical_type m_data_type;
120};
121
122} // namespace rexlib
Description of the memory representation of a multidimensional array.
Definition array_descriptor.hpp:22
Container for multidimensional numeric data.
Definition array.hpp:31
Shape and data type of an operand.
Definition operand_specification.hpp:24
const shape_type & get_shape() const noexcept
Get the extent of every axis.
numerical_type get_data_type() const noexcept
Get the type of the elements.
void set_data_type(numerical_type data_type) noexcept
Set the type of the elements.
operand_specification() noexcept
Construct a specification with no axes and an unknown type.
static operand_specification from_descriptor(const array_descriptor &descriptor)
Get the specification of an operand with a given descriptor.
void set_shape(shape_type shape) noexcept
Set the extent of every axis.
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
numerical_type
Representation of all considered numerical types for computations.
Definition numerical_type.hpp:19