arrow2::compute

Module arithmetics

Source
Available on crate feature compute_arithmetics only.
Expand description

Defines basic arithmetic kernels for PrimitiveArrays.

The Arithmetics module is composed by basic arithmetics operations that can be performed on PrimitiveArray.

Whenever possible, each operation declares variations of the basic operation that offers different guarantees:

  • plain: panics on overflowing and underflowing.
  • checked: turns an overflowing to a null.
  • saturating: turns the overflowing to the MAX or MIN value respectively.
  • overflowing: returns an extra Bitmap denoting whether the operation overflowed.
  • adaptive: for Decimal only, adjusts the precision and scale to make the resulting value fit.

Modules§

basic
Contains arithemtic functions for PrimitiveArrays.
decimal
Defines the arithmetic kernels for Decimal PrimitiveArrays. The Decimal type specifies the precision and scale parameters. These affect the arithmetic operations and need to be considered while doing operations with Decimal numbers.
time
Defines the arithmetic kernels for adding a Duration to a Timestamp, Time32, Time64, Date32 and Date64.

Traits§

ArrayAdd
Defines basic addition operation for primitive arrays
ArrayCheckedAdd
Defines checked addition operation for primitive arrays
ArrayCheckedDiv
Defines checked division operation for primitive arrays
ArrayCheckedMul
Defines checked multiplication operation for primitive arrays
ArrayCheckedRem
Defines checked reminder operation for primitive arrays
ArrayCheckedSub
Defines checked subtraction operation for primitive arrays
ArrayDiv
Defines basic division operation for primitive arrays
ArrayMul
Defines basic multiplication operation for primitive arrays
ArrayOverflowingAdd
Defines Overflowing addition operation for primitive arrays
ArrayOverflowingMul
Defines Overflowing multiplication operation for primitive arrays
ArrayOverflowingSub
Defines Overflowing subtraction operation for primitive arrays
ArrayRem
Defines basic reminder operation for primitive arrays
ArraySaturatingAdd
Defines saturating addition operation for primitive arrays
ArraySaturatingMul
Defines saturating multiplication operation for primitive arrays
ArraySaturatingSub
Defines saturating subtraction operation for primitive arrays
ArraySub
Defines basic subtraction operation for primitive arrays
ArrayWrappingAdd
Defines wrapping addition operation for primitive arrays
ArrayWrappingMul
Defines wrapping multiplication operation for primitive arrays
ArrayWrappingSub
Defines wrapping subtraction operation for primitive arrays

Functions§

add
Adds two Arrays.
add_scalar
Adds an Array and a Scalar.
can_add
Returns whether two DataTypes can be added by add.
can_div
Returns whether two DataTypes can be divided by div.
can_mul
Returns whether two DataTypes can be multiplied by mul.
can_neg
Whether neg is supported for a given DataType
can_rem
Returns whether two DataTypes “can be remainder” by rem.
can_sub
Returns whether two DataTypes can be subtracted by sub.
div
Divide of two Arrays.
div_scalar
Divide an Array with a Scalar.
mul
Multiply two Arrays.
mul_scalar
Multiply an Array with a Scalar.
neg
Negates an Array.
rem
Remainder of two Arrays.
sub
Subtracts two Arrays.
sub_scalar
Adds an Array and a Scalar.