|
rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
|
The declarations of the operations: their operands, parameters and rules. More...
Classes | |
| class | abs_operation |
| Compute the absolute value of each element of the input array. More... | |
| class | acos_operation |
| Compute the arc cosine of each element. More... | |
| class | acosh_operation |
| Compute the inverse hyperbolic cosine of each element. More... | |
| class | add_operation |
| Add the elements of two input arrays into an output array. More... | |
| class | all_operation |
| Test whether every element along the reduced axes is true. More... | |
| class | amax_operation |
| Take the largest element along the reduced axes. More... | |
| class | amin_operation |
| Take the smallest element along the reduced axes. More... | |
| class | angle_operation |
| Compute the argument of each element of the input array. More... | |
| class | any_operation |
| Test whether any element along the reduced axes is true. More... | |
| class | arange_operation |
Write the arithmetic progression start + i * step. More... | |
| class | argmax_operation |
| Locate the largest element along the reduced axes. More... | |
| class | argmin_operation |
| Locate the smallest element along the reduced axes. More... | |
| class | asin_operation |
| Compute the arc sine of each element. More... | |
| class | asinh_operation |
| Compute the inverse hyperbolic sine of each element. More... | |
| class | atan2_operation |
| Compute the arc tangent of two arrays, by quadrant. More... | |
| class | atan_operation |
| Compute the arc tangent of each element. More... | |
| class | atanh_operation |
| Compute the inverse hyperbolic tangent of each element. More... | |
| struct | axes_of |
| Accessor reading the axes an operation acts along. More... | |
| class | axis_selection |
| The axes an operation acts along. More... | |
| class | bitwise_and_operation |
| Compute the bitwise conjunction of two arrays. More... | |
| class | bitwise_not_operation |
| Invert the bits of each element of the input array. More... | |
| class | bitwise_or_operation |
| Compute the bitwise disjunction of two arrays. More... | |
| class | bitwise_xor_operation |
| Compute the bitwise exclusive disjunction of two arrays. More... | |
| class | cbrt_operation |
| Compute the cube root of each element of the input array. More... | |
| class | ceil_operation |
| Round each element of the input array upwards. More... | |
| class | clip_operation |
| Confine the elements of an array to an interval. More... | |
| class | conjugate_operation |
| Conjugate each element of the input array. More... | |
| class | copy_operation |
| Copy elements from an input array to an output array. More... | |
| class | copysign_operation |
| Take the magnitude of one array and the sign of another. More... | |
| class | cos_operation |
| Compute the cosine of each element. More... | |
| class | cosh_operation |
| Compute the hyperbolic cosine of each element. More... | |
| class | count_nonzero_operation |
| Count the non zero elements along the reduced axes. More... | |
| struct | count_of |
| Accessor reading the number of values an operation produces. More... | |
| class | cross_operation |
| Take the cross product of two arrays along one axis. More... | |
| class | degrees_operation |
| Convert each element of the input array to degrees. More... | |
| class | divide_operation |
| Divide the elements of two input arrays into an output array. More... | |
| class | divmod_operation |
| Divide two arrays, producing the quotient and remainder. More... | |
| class | equal_operation |
| Test whether the elements of one array are equal to those of another. More... | |
| class | exp2_operation |
| Raise two to the power of each element of the input array. More... | |
| class | exp_operation |
| Raise e to the power of each element of the input array. More... | |
| class | expm1_operation |
| Compute the exponential of each element, minus one. More... | |
| struct | extent_of |
| Accessor reading the extent an operation fixes. More... | |
| class | fft_operation |
| Transform an array to the frequency domain. More... | |
| class | fftshift_operation |
| Move the zero frequency of a spectrum to its centre. More... | |
| class | fill_operation |
| Fill an array with a constant value. More... | |
| class | floor_divide_operation |
| Divide two input arrays, rounding the quotient downwards. More... | |
| class | floor_operation |
| Round each element of the input array downwards. More... | |
| class | fold_in_key_operation |
| Derive keys from keys and values. More... | |
| class | greater_equal_operation |
| Test whether the elements of one array are greater than or equal to those of another. More... | |
| class | greater_operation |
| Test whether the elements of one array are greater than those of another. More... | |
| struct | half_spectrum_extent_transform |
| Transform mapping the extent of a real signal onto the extent of its half spectrum. More... | |
| class | hypot_operation |
| Compute the hypotenuse of two arrays. More... | |
| class | ifft_operation |
| Transform an array back from the frequency domain. More... | |
| class | ifftshift_operation |
| Move the zero frequency of a spectrum back to its origin. More... | |
| class | irfft_operation |
| Transform a half spectrum back into a real array. More... | |
| class | is_finite_operation |
| Test whether each element is neither infinite nor not a number. More... | |
| class | is_inf_operation |
| Test whether each element is infinite. More... | |
| class | is_nan_operation |
| Test whether each element is not a number. More... | |
| struct | keep_dimensions_of |
| Accessor reading whether an operation keeps the axes it removes with an extent of one. More... | |
| class | left_shift_operation |
| Shift the bits of an array leftwards. More... | |
| class | less_equal_operation |
| Test whether the elements of one array are less than or equal to those of another. More... | |
| class | less_operation |
| Test whether the elements of one array are less than those of another. More... | |
| class | linspace_operation |
| Write evenly spaced samples of the segment from start to stop. More... | |
| class | log10_operation |
| Compute the base ten logarithm of each element. More... | |
| class | log1p_operation |
| Compute the natural logarithm of one plus each element. More... | |
| class | log2_operation |
| Compute the base two logarithm of each element. More... | |
| class | log_operation |
| Compute the natural logarithm of each element. More... | |
| class | logical_and_operation |
| Compute the conjunction of two arrays. More... | |
| class | logical_not_operation |
| Compute the negation of an array. More... | |
| class | logical_or_operation |
| Compute the disjunction of two arrays. More... | |
| class | logical_xor_operation |
| Compute the exclusive disjunction of two arrays. More... | |
| class | matmul_operation |
| Multiply two arrays as stacks of matrices. More... | |
| class | matvec_operation |
| Multiply a stack of matrices by a stack of vectors. More... | |
| class | maximum_operation |
| Take the larger of each pair of elements. More... | |
| class | mean_operation |
| Average the elements along the reduced axes. More... | |
| class | minimum_operation |
| Take the smaller of each pair of elements. More... | |
| class | modulo_operation |
| Compute the division remainder of two input arrays. More... | |
| class | multiply_operation |
| Multiply the elements of two input arrays into an output array. More... | |
| class | negate_operation |
| Negate each element of the input array into the output array. More... | |
| class | not_equal_operation |
| Test whether the elements of one array are different from those of another. More... | |
| struct | ops_component |
| Component tag for the generic operation catalog. More... | |
| class | power_operation |
| Raise the elements of an array to the power of another. More... | |
| class | product_operation |
| Multiply the elements along the reduced axes. More... | |
| class | radians_operation |
| Convert each element of the input array to radians. More... | |
| class | reciprocal_operation |
| Divide one by each element of the input array. More... | |
| class | reduction_axes |
| The axes a reduction acts along, and whether its result keeps them with an extent of one. More... | |
| class | restored_signal_axes |
| The axes an inverse real transform acts along, and the extent of the last of them. More... | |
| class | rfft_operation |
| Transform a real array to the frequency domain. More... | |
| class | right_shift_operation |
| Shift the bits of an array rightwards. More... | |
| class | round_operation |
| Round each element of the input array to the nearest. More... | |
| class | sequence_length |
| The number of values a sequence holds. More... | |
| class | sign_bit_operation |
| Test whether the sign bit of each element is set. More... | |
| class | sign_operation |
| Extract the sign of each element of the input array. More... | |
| class | sin_operation |
| Compute the sine of each element. More... | |
| class | sincos_operation |
| Compute the sine and cosine of each element at once. More... | |
| class | sinh_operation |
| Compute the hyperbolic sine of each element. More... | |
| class | split_key_operation |
| Derive a sequence of keys from every key. More... | |
| class | sqrt_operation |
| Compute the square root of each element of the input array. More... | |
| class | square_operation |
| Multiply each element of the input array by itself. More... | |
| class | subtract_operation |
| Subtract the elements of two input arrays into an output array. More... | |
| class | sum_operation |
| Add the elements of the input array along the reduced axes. More... | |
| class | tan_operation |
| Compute the tangent of each element. More... | |
| class | tanh_operation |
| Compute the hyperbolic tangent of each element. More... | |
| class | trunc_operation |
| Round each element of the input array towards zero. More... | |
| class | vecdot_operation |
| Contract two arrays along one axis, broadcasting the rest. More... | |
| class | vecmat_operation |
| Multiply a stack of conjugated vectors by a stack of matrices. More... | |
| class | where_operation |
| Select between two arrays according to a condition. More... | |
Enumerations | |
| enum class | fourier_normalization { backward , ortho , forward } |
| Which of a transform pair carries the scaling. More... | |
| enum class | fourier_direction { forward , inverse } |
| Which way round a transform goes. More... | |
Functions | |
| REXLIB_DECLARE_OPERATION_TRAITS (fill, ops_component, REXLIB_OPERANDS("destination"), REXLIB_OPERANDS(), nullary_elementwise_shape_rule, nullary_free_rule<>) | |
| REXLIB_DECLARE_PARAMETRIC_OPERATION_TRAITS (arange, ops_component, REXLIB_OPERANDS("result"), REXLIB_OPERANDS(), sequence_shape_rule, sequence_length, nullary_free_rule< real_arithmetic_type_domain >) | |
| REXLIB_DECLARE_PARAMETRIC_OPERATION_TRAITS (linspace, ops_component, REXLIB_OPERANDS("result"), REXLIB_OPERANDS(), sequence_shape_rule, sequence_length, nullary_free_rule< inexact_type_domain >) | |
| REXLIB_DECLARE_PARAMETRIC_OPERATION_TRAITS (fft, ops_component, REXLIB_OPERANDS("spectrum"), REXLIB_OPERANDS("signal"), fourier_transform_shape_rule, axis_selection, unary_complex_of_rule< inexact_type_domain >) | |
| const char * | to_string (fourier_normalization normalization) noexcept |
| std::ostream & | operator<< (std::ostream &os, fourier_normalization normalization) |
| const char * | to_string (fourier_direction direction) noexcept |
| std::ostream & | operator<< (std::ostream &os, fourier_direction direction) |
| double | get_fourier_scale (fourier_normalization normalization, fourier_direction direction, std::size_t sample_count) noexcept |
| Get the factor a transform multiplies its result by. | |
| REXLIB_DECLARE_PARAMETRIC_OPERATION_TRAITS (ifft, ops_component, REXLIB_OPERANDS("signal"), REXLIB_OPERANDS("spectrum"), fourier_transform_shape_rule, axis_selection, unary_homogeneous_rule< complex_type_domain >) | |
| REXLIB_DECLARE_PARAMETRIC_OPERATION_TRAITS (irfft, ops_component, REXLIB_OPERANDS("signal"), REXLIB_OPERANDS("spectrum"), inverse_real_fourier_transform_shape_rule, restored_signal_axes, unary_real_of_rule< complex_type_domain >) | |
| REXLIB_DECLARE_PARAMETRIC_OPERATION_TRAITS (rfft, ops_component, REXLIB_OPERANDS("spectrum"), REXLIB_OPERANDS("signal"), real_fourier_transform_shape_rule, axis_selection, unary_complex_of_rule< floating_point_type_domain >) | |
| REXLIB_DECLARE_PARAMETRIC_OPERATION_TRAITS (split_key, ops_component, REXLIB_OPERANDS("result"), REXLIB_OPERANDS("key"), elementwise_sequence_shape_rule, sequence_length, unary_homogeneous_rule< single_type_domain< numerical_type::uint64 > >) | |
The declarations of the operations: their operands, parameters and rules.
| using rexlib::ops::axis_half_spectrum_of = typedef extent_slot<E, half_spectrum_extent_transform> |
Axis holding the half spectrum of an extent variable.
| E | Index of the extent variable. |
| using rexlib::ops::axis_list = typedef std::vector<std::size_t> |
The axes an operation acts along.
Explicit and non negative. An axis referred from the end is resolved by whoever holds the array, since resolving it needs the rank.
Which way round a transform goes.
Half of what a scale factor depends on, the other half being the convention. It is a property of the operation rather than a parameter of it: there is no transform that is forward or inverse depending on what it is told.
| Enumerator | |
|---|---|
| forward | From the signal domain to the frequency domain. |
| inverse | From the frequency domain back to the signal domain. |
Which of a transform pair carries the scaling.
A discrete Fourier transform followed by its inverse multiplies a signal by the number of samples, so one of the two has to divide it back out. Which one is a convention rather than a fact, and this is it.
The convention is named rather than the factor itself so that a transform and its inverse undo one another whenever they are given the same one. A caller that names a factor per transform instead is left to pair the two up correctly, and pairing them wrongly is silent.
There is deliberately no "none": it would be fourier_normalization::backward on a forward transform and fourier_normalization::forward on an inverse one, so it names no scaling that cannot already be asked for, and two spellings of one operation are two programs where there should be one.
|
noexcept |
Get the factor a transform multiplies its result by.
Exported because every backend needs it and none of them is given the convention itself: pocketfft and MKL take a factor, FFTW and cuFFT take nothing at all and have to apply one themselves. Deriving it here, once, is what keeps a transform meaning the same thing whichever of them runs it.
| normalization | Which of the transform pair carries the scaling. |
| direction | Which way round this transform goes. |
| sample_count | The number of samples reaching each transformed value, which is the product of the signal extents along the transformed axes. The signal is the operand that is not a half spectrum, so a real transform and its inverse are both measured against the real operand rather than against the coefficients actually stored. A count of zero returns one, there being nothing to scale. |