|
rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
|
Write the arithmetic progression start + i * step.
More...
#include <rexlib/ops/creation/arange_operation.hpp>
Public Member Functions | |
| arange_operation (const scalar_value &start, const scalar_value &step, std::size_t count) | |
| Construct an arange operation. | |
| const scalar_value & | get_start () const noexcept |
| Get the value of the first element. | |
| const scalar_value & | get_step () const noexcept |
| Get the difference between consecutive elements. | |
| std::size_t | get_count () const noexcept |
| Get the number of elements written. | |
Public Member Functions inherited from rexlib::parametric_operation< arange_operation, arange_operation_traits > | |
| parametric_operation (Args &&... args) | |
| Construct the operation by constructing its parameters. | |
| const parameters_type & | get_parameters () const noexcept |
| Get the parameters of the operation. | |
| const operation_signature & | get_signature () const noexcept override |
| Get the signature deciding the shape and data type of the operands of this operation. | |
Public Member Functions inherited from rexlib::basic_operation< Derived, Traits > | |
| const operation_descriptor & | get_descriptor () const noexcept override |
| Get the description of this operation. | |
| operation_id | get_id () const noexcept override |
Get the identifier of Derived. | |
Public Member Functions inherited from rexlib::operation | |
| operation (const operation &other)=delete | |
| operation (operation &&other)=delete | |
| operation & | operator= (const operation &other)=delete |
| operation & | operator= (operation &&other)=delete |
Additional Inherited Members | |
Public Types inherited from rexlib::parametric_operation< arange_operation, arange_operation_traits > | |
| using | parameters_type = typename Traits::parameters_type |
| using | signature_type = rule_signature< shape_rule_type, type_rule_type, parameters_type > |
Public Types inherited from rexlib::basic_operation< Derived, Traits > | |
| using | traits_type = Traits |
| using | shape_rule_type = typename Traits::shape_rule_type |
| using | type_rule_type = typename Traits::type_rule_type |
Static Public Member Functions inherited from rexlib::basic_operation< Derived, Traits > | |
| static const operation_descriptor & | get_static_descriptor () noexcept |
| Get the description shared by every instance. | |
Static Public Attributes inherited from rexlib::basic_operation< Derived, Traits > | |
| static REXLIB_CONST_CONSTEXPR std::size_t | output_operand_count |
| static REXLIB_CONST_CONSTEXPR std::size_t | input_operand_count |
Write the arithmetic progression start + i * step.
The operation holds the first value, the step and how many elements to write, rather than the half open range a caller thinks in: where the progression stops is a question about values, and answering it is what fixes the length. That answer belongs to whoever asked for the range, because a shape has to be known before an operand can be allocated.
The i-th element is computed from i rather than from the one before it, so its error does not depend on how far into the sequence it sits.
The domain excludes the complex types: a progression needs an ordering to be asked where it stops, and the complex plane has none. Use linspace_operation, which is told its length outright, for a complex ramp.
| rexlib::ops::arange_operation::arange_operation | ( | const scalar_value & | start, |
| const scalar_value & | step, | ||
| std::size_t | count | ||
| ) |
Construct an arange operation.
| start | Value of the first element. |
| step | Difference between one element and the next. It is not required to be non zero: a degenerate step writes a constant sequence, and it is the range to length conversion, not the operation, that has a reason to reject one. |
| count | Number of elements to write. |
|
noexcept |
Get the number of elements written.
|
noexcept |
Get the value of the first element.
|
noexcept |
Get the difference between consecutive elements.