rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
Typedefs
Common operand type rules

Typedefs

template<typename Domain = any_type_domain>
using rexlib::ops::unary_homogeneous_rule = operand_type_rule< type_list< pivot_from_input< 0, Domain > >, type_list< slot_same_as< 0 > >, type_list< slot_same_as< 0 > > >
 Unary operation whose operands share one element type.
 
template<typename Domain = any_type_domain>
using rexlib::ops::binary_homogeneous_rule = operand_type_rule< type_list< pivot_from_input< 0, Domain > >, type_list< slot_same_as< 0 > >, type_list< slot_same_as< 0 >, slot_same_as< 0 > > >
 Binary operation whose operands share one element type.
 
template<typename Domain = any_type_domain>
using rexlib::ops::ternary_homogeneous_rule = operand_type_rule< type_list< pivot_from_input< 0, Domain > >, type_list< slot_same_as< 0 > >, type_list< slot_same_as< 0 >, slot_same_as< 0 >, slot_same_as< 0 > > >
 Ternary operation whose operands share one element type.
 
template<typename Domain = arithmetic_type_domain>
using rexlib::ops::unary_real_of_rule = operand_type_rule< type_list< pivot_from_input< 0, Domain > >, type_list< slot_real_of< 0 > >, type_list< slot_same_as< 0 > > >
 Unary operation producing the real counterpart of its input.
 
template<typename Domain = inexact_type_domain>
using rexlib::ops::unary_complex_of_rule = operand_type_rule< type_list< pivot_from_input< 0, Domain > >, type_list< slot_complex_of< 0 > >, type_list< slot_same_as< 0 > > >
 Unary operation producing the complex counterpart of its input.
 
template<typename Domain = arithmetic_type_domain>
using rexlib::ops::unary_inexact_of_rule = operand_type_rule< type_list< pivot_from_input< 0, Domain > >, type_list< slot_inexact_of< 0 > >, type_list< slot_same_as< 0 > > >
 Unary operation producing the inexact counterpart of its input.
 
template<numerical_type Type, typename Domain = any_type_domain>
using rexlib::ops::unary_fixed_output_rule = operand_type_rule< type_list< pivot_from_input< 0, Domain > >, type_list< slot_fixed< Type > >, type_list< slot_same_as< 0 > > >
 Unary operation whose output has a fixed element type.
 
template<typename Domain = any_type_domain>
using rexlib::ops::unary_predicate_rule = unary_fixed_output_rule< numerical_type::boolean, Domain >
 Unary operation producing a boolean output.
 
template<typename Domain = any_type_domain>
using rexlib::ops::binary_predicate_rule = operand_type_rule< type_list< pivot_from_input< 0, Domain > >, type_list< slot_fixed< numerical_type::boolean > >, type_list< slot_same_as< 0 >, slot_same_as< 0 > > >
 Binary comparison producing a boolean output.
 
template<typename Domain = inexact_type_domain>
using rexlib::ops::unary_homogeneous_pair_rule = operand_type_rule< type_list< pivot_from_input< 0, Domain > >, type_list< slot_same_as< 0 >, slot_same_as< 0 > >, type_list< slot_same_as< 0 > > >
 Unary operation producing two outputs of the operand type.
 
template<typename Domain = real_arithmetic_type_domain>
using rexlib::ops::binary_homogeneous_pair_rule = operand_type_rule< type_list< pivot_from_input< 0, Domain > >, type_list< slot_same_as< 0 >, slot_same_as< 0 > >, type_list< slot_same_as< 0 >, slot_same_as< 0 > > >
 Binary operation producing two outputs of the operand type.
 
template<typename Domain = arithmetic_type_domain>
using rexlib::ops::masked_unary_homogeneous_rule = operand_type_rule< type_list< pivot_from_input< 0, Domain > >, type_list< slot_same_as< 0 > >, type_list< slot_same_as< 0 >, slot_fixed< numerical_type::boolean > > >
 Unary operation taking a boolean mask alongside its operand.
 
template<typename Domain = arithmetic_type_domain>
using rexlib::ops::masked_binary_homogeneous_rule = operand_type_rule< type_list< pivot_from_input< 0, Domain > >, type_list< slot_same_as< 0 > >, type_list< slot_same_as< 0 >, slot_same_as< 0 >, slot_fixed< numerical_type::boolean > > >
 Binary operation taking a boolean mask alongside its operands.
 
template<typename Domain = floating_point_type_domain, numerical_type Key = numerical_type::uint64>
using rexlib::ops::keyed_unary_homogeneous_rule = operand_type_rule< type_list< pivot_from_input< 0, Domain > >, type_list< slot_same_as< 0 > >, type_list< slot_same_as< 0 >, slot_fixed< Key > > >
 Unary operation taking a key of a fixed element type alongside its operand.
 
template<typename Domain = any_type_domain>
using rexlib::ops::selection_rule = operand_type_rule< type_list< pivot_from_input< 1, Domain > >, type_list< slot_same_as< 0 > >, type_list< slot_fixed< numerical_type::boolean >, slot_same_as< 0 >, slot_same_as< 0 > > >
 Selection between two operands driven by a boolean condition.
 
template<typename FirstDomain = floating_point_type_domain, typename SecondDomain = signed_integer_type_domain>
using rexlib::ops::binary_heterogeneous_rule = operand_type_rule< type_list< pivot_from_input< 0, FirstDomain >, pivot_from_input< 1, SecondDomain > >, type_list< slot_same_as< 0 > >, type_list< slot_same_as< 0 >, slot_same_as< 1 > > >
 Binary operation whose operands have unrelated element types.
 
template<typename Domain = any_type_domain>
using rexlib::ops::nullary_free_rule = operand_type_rule< type_list< pivot_from_output< 0, Domain > >, type_list< slot_same_as< 0 > >, type_list<> >
 Nullary operation whose output element type is free.
 
template<typename OutputDomain = any_type_domain, typename InputDomain = any_type_domain>
using rexlib::ops::converting_rule = operand_type_rule< type_list< pivot_from_output< 0, OutputDomain, 1 >, pivot_from_input< 0, InputDomain > >, type_list< slot_same_as< 0 > >, type_list< slot_same_as< 1 > > >
 Unary operation whose output element type is independent.
 

Detailed Description

The typing rules the operation catalog is built from. An operation names one of these in its declaration and that is the whole of its typing: the type rule interpreter and every backend type dispatcher read the same rule.

Every rule is parameterised by the domain of its element type, which is how an operation states what it accepts. A rule says nothing about shapes, so the same rule serves an elementwise operation and a reduction.

Typedef Documentation

◆ binary_heterogeneous_rule

Binary operation whose operands have unrelated element types.

Models operations combining values of two different kinds, such as scaling a floating point value by an integer power of two. The output follows the first operand.

A backend dispatches the cartesian product of the two pivot domains, so such a rule costs an order of magnitude more instantiations than a single pivot one. Keep the second domain as narrow as the operation allows.

Template Parameters
FirstDomainThe admissible element types of the first operand.
SecondDomainThe admissible element types of the second operand.

◆ binary_homogeneous_pair_rule

Binary operation producing two outputs of the operand type.

Models operations computing two related results in one pass, such as the quotient and the remainder of a division.

Template Parameters
DomainThe admissible element types.

◆ binary_homogeneous_rule

Binary operation whose operands share one element type.

Template Parameters
DomainThe admissible element types.

◆ binary_predicate_rule

Binary comparison producing a boolean output.

Template Parameters
DomainThe admissible input element types.

◆ converting_rule

Unary operation whose output element type is independent.

The output adopts the input element type unless the user pre-allocates an output of a different one, which is what makes a converting copy possible without a separate operation.

Template Parameters
OutputDomainThe admissible output element types.
InputDomainThe admissible input element types.

◆ keyed_unary_homogeneous_rule

Unary operation taking a key of a fixed element type alongside its operand.

The output has the element type of the operand. The key, such as the seed of a random draw, has its own fixed element type.

Template Parameters
DomainThe admissible element types of the operand.
KeyThe element type of the key.

◆ masked_binary_homogeneous_rule

Binary operation taking a boolean mask alongside its operands.

Template Parameters
DomainThe admissible element types of the masked operands.

◆ masked_unary_homogeneous_rule

Unary operation taking a boolean mask alongside its operand.

The mask is an operand rather than a parameter, so it takes part in the shape deduction like any other and may be broadcast against the operand it selects from.

Template Parameters
DomainThe admissible element types of the masked operand.

◆ nullary_free_rule

Nullary operation whose output element type is free.

With no input to fix it, the element type is whatever the user supplied output carries. Models operations that write a value into an existing array, such as fill.

Template Parameters
DomainThe admissible output element types.

◆ selection_rule

Selection between two operands driven by a boolean condition.

The element type follows the operands being selected from and not the condition, which is why the pivot is taken from the second input rather than the first.

Template Parameters
DomainThe admissible element types of the selected operands.

◆ ternary_homogeneous_rule

Ternary operation whose operands share one element type.

Template Parameters
DomainThe admissible element types.

◆ unary_complex_of_rule

Unary operation producing the complex counterpart of its input.

Template Parameters
DomainThe admissible input element types.

◆ unary_fixed_output_rule

Unary operation whose output has a fixed element type.

Models operations whose result does not carry the input's type at all, such as a predicate or one producing indices.

Template Parameters
TypeThe element type of the output.
DomainThe admissible input element types.

◆ unary_homogeneous_pair_rule

Unary operation producing two outputs of the operand type.

Models operations computing two related results from one operand in a single pass, such as the sine and the cosine of an angle.

Template Parameters
DomainThe admissible element types.

◆ unary_homogeneous_rule

Unary operation whose operands share one element type.

Template Parameters
DomainThe admissible element types.

◆ unary_inexact_of_rule

Unary operation producing the inexact counterpart of its input.

Models operations whose result has a fractional part the operand's own type could not hold, such as a mean, and leaves floating point and complex inputs untouched.

Template Parameters
DomainThe admissible input element types.

◆ unary_predicate_rule

template<typename Domain = any_type_domain>
using rexlib::ops::unary_predicate_rule = typedef unary_fixed_output_rule< numerical_type::boolean, Domain >

Unary operation producing a boolean output.

Template Parameters
DomainThe admissible input element types.

◆ unary_real_of_rule

Unary operation producing the real counterpart of its input.

Models operations that drop the imaginary part, such as abs, and leaves non complex inputs untouched.

Template Parameters
DomainThe admissible input element types.