Module unary

Module unary 

Source
Expand description

§Unary Operations Kernels Module - Single-Array Transformations

Unary operation kernels for single-array transformations with SIMD acceleration and null-aware semantics. Essential building blocks for data preprocessing, mathematical transformations, and analytical computations.

§Core Operations

  • Mathematical functions: Absolute value, negation, square root, logarithmic, and trigonometric functions
  • Type casting: Safe and unsafe type conversions with overflow detection
  • Boolean operations: Logical NOT operations on boolean arrays with bitmask optimisation
  • Null handling: NULL coalescing and null indicator operations
  • Statistical transforms: Standardisation, normalisation, and ranking operations
  • String transformations: Length calculation, case conversion, and format operations

Constants§

W8
Auto-generated SIMD lane widths from build.rs SIMD lane count for 8-bit elements (u8, i8). Determined at build time based on target architecture capabilities, or overridden via SIMD_LANES_OVERRIDE.
W16
SIMD lane count for 16-bit elements (u16, i16). Determined at build time based on target architecture capabilities, or overridden via SIMD_LANES_OVERRIDE.
W32
SIMD lane count for 32-bit elements (u32, i32, f32). Determined at build time based on target architecture capabilities, or overridden via SIMD_LANES_OVERRIDE.
W64
SIMD lane count for 64-bit elements (u64, i64, f64). Determined at build time based on target architecture capabilities, or overridden via SIMD_LANES_OVERRIDE.

Functions§

unary_neg_f32
Negates all elements in a floating-point array.
unary_neg_f64
Negates all elements in a floating-point array.
unary_neg_i32
Negates all elements in an integer array.
unary_neg_i64
Negates all elements in an integer array.
unary_negate_float
Generic floating-point negation dispatcher.
unary_negate_int
Generic integer negation dispatcher.
unary_negate_u32_to_i32
Negates u32 values and converts them to i32.
unary_negate_u64_to_i64
Negates u64 values and converts them to i64.
unary_not_bool
Applies logical NOT to boolean values element-wise with SIMD acceleration.\n///\n/// Performs bitwise logical negation on boolean arrays using vectorised operations\n/// with configurable lane width for optimal performance.\n///\n/// # Parameters\n/// - arr_window: Boolean array view tuple (BooleanArray, offset, length)\n///\n/// # Const Generics\n/// - LANES: SIMD lane count for vectorised operations (typically W64)\n///\n/// # Returns\n/// Result<BooleanArray<()>, KernelError> with logically negated boolean values.\n///\n/// # Errors\n/// May return KernelError for invalid array configurations or memory issues.\n///\n/// # Performance\n/// Uses SIMD bitwise NOT operations with lane-parallel processing for bulk negation.
unary_reverse_dict
Reverses the character order within each string in a categorical array dictionary.
unary_reverse_str
Reverses the character order within each string in a string array.