rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
Classes
Type transforms

Classes

struct  rexlib::complex_type_transform
 Transform mapping a pivot type onto its complex counterpart. More...
 
struct  rexlib::fixed_type_transform< Type >
 Transform ignoring the pivot and yielding a fixed type. More...
 
struct  rexlib::inexact_type_transform
 Transform mapping a pivot type onto its inexact counterpart. More...
 
struct  rexlib::real_type_transform
 Transform mapping a pivot type onto its real counterpart. More...
 
struct  rexlib::same_type_transform
 Transform mapping a pivot type onto itself. More...
 

Detailed Description

A transform maps the type of a rule's pivot onto the type of one operand.

Every transform states the same mapping twice:

The two halves must agree: for every native type T admitted by domain_type,

numerical_type_of<typename apply_type<T>::type>::value ==
    apply(numerical_type_of<T>::value)

This is machine checked for every transform by the transform tests, which is what makes it safe to write a typing rule once and have both sides interpret it.

A transform also declares domain_type, the set of pivot types it is defined on. A rule intersects it with the domain the operation declares, so a rule can never resolve to a type its own transforms cannot map.

get_relation returns a fragment naming the mapping, used to build diagnostics such as "output operand 'result' must be the real counterpart of input operand 'value'".