|
rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
|
Operation signature made of a shape rule and a typing rule. More...
#include <rexlib/core/operation/rule_signature.hpp>
Public Types | |
| using | parameters_type = Parameters |
Public Member Functions | |
| template<typename... Args, typename = typename std::enable_if< std::is_constructible<Parameters, Args...>::value >::type> | |
| rule_signature (Args &&... args) | |
| Construct the signature by constructing its parameters. | |
| const Parameters & | get_parameters () const noexcept |
| Get the parameters of the operation instance. | |
| void | check_parameters (const operation_descriptor &descriptor) const |
| Check the parameters against the rules. | |
| void | deduce (const operation_descriptor &descriptor, span< operand_specification > canonical_outputs, span< const operand_specification > inputs) const override |
| Compute the output operands the inputs call for. | |
| void | accept (const operation_descriptor &descriptor, span< const operand_specification > user_outputs, span< const operand_specification > inputs) const override |
| Decide whether output operands supplied in advance are admissible. | |
| operation_arity | get_arity () const noexcept override |
| Get the number of output and input operands. | |
Public Member Functions inherited from rexlib::operation_signature | |
| operation_signature (const operation_signature &other)=delete | |
| operation_signature (operation_signature &&other)=delete | |
| operation_signature & | operator= (const operation_signature &other)=delete |
| operation_signature & | operator= (operation_signature &&other)=delete |
Operation signature made of a shape rule and a typing rule.
Owns the parameters of an operation instance and reads from them, through the accessors the rules name, whatever the rules depend on. The shape rule decides the shapes of the operands and the typing rule their data types, each without the other.
| ShapeRule | The operand_shape_rule. |
| TypeRule | The operand_type_rule. |
| Parameters | The parameter type of the operation, no_parameters for an operation without any. |
|
explicit |
Construct the signature by constructing its parameters.
| Args | Constructor argument types of the parameters. |
| args | Forwarded to the parameters. |
|
overridevirtual |
Decide whether output operands supplied in advance are admissible.
| descriptor | Description of the operation, used to name the operation and its operands when reporting a rejection. |
| user_outputs | The output operands supplied in advance. |
| inputs | The input operands. |
| std::invalid_argument | When an output is not admissible. |
| std::out_of_range | When the signature names an axis beyond the rank of the operands. |
Implements rexlib::operation_signature.
| void rexlib::rule_signature< ShapeRule, TypeRule, Parameters >::check_parameters | ( | const operation_descriptor & | descriptor | ) | const |
Check the parameters against the rules.
Checks what does not depend on the operands, such as how many axes are named, so that an operation can reject its parameters when it is built rather than when it is first executed.
| descriptor | Description of the operation, used to name it when reporting a rejection. |
| std::invalid_argument | When a parameter is not admissible. |
|
overridevirtual |
Compute the output operands the inputs call for.
A data type the inputs do not determine is left as numerical_type::unknown, for an output supplied in advance to fix.
| descriptor | Description of the operation, used to name the operation and its operands when reporting a rejection. |
| canonical_outputs | Output buffer, sized to the operation's output arity. |
| inputs | The input operands. |
| std::invalid_argument | When the inputs are not admissible. |
| std::out_of_range | When the signature names an axis beyond the rank of the operands. |
Implements rexlib::operation_signature.
|
overridevirtualnoexcept |
Get the number of output and input operands.
deduce and accept take. Implements rexlib::operation_signature.
|
noexcept |
Get the parameters of the operation instance.