Skip to main content

Module arithmetic

Module arithmetic 

Source
Expand description

Traits for arithmetic on UnsignedVectors.

Modules§

canonical_primitive_part
Implementations of CanonicalPrimitivePart, CanonicalPrimitivePartAssign, and ContentAndCanonicalPrimitivePart, which, for a vector with non-negative elements, are the same as the primitive part.
content
Implementations of Content, PrimitivePart, PrimitivePartAssign, and ContentAndPrimitivePart, which compute the GCD of a vector’s elements and the vector divided by it.
content_chained
Implementations of ContentChained, which computes the GCD of a number and a vector’s elements.
div_exact
Exact division of a vector by a scalar, by implementations of DivExact and DivExactAssign.
entrywise_div_round
Dividing every element of a vector by a scalar and rounding each quotient, by implementations of EntrywiseDivRound and EntrywiseDivRoundAssign.
entrywise_shr_round
Right-shifting a vector (dividing it by a power of 2) and rounding every element, by implementations of EntrywiseShrRound and EntrywiseShrRoundAssign.
height
An implementation of Height, the largest height of any element.
mod_abs_squared
Implementations of ModAbsSquared, the squared norm of a vector modulo a number.
mod_add
Implementations of ModAdd and ModAddAssign, for adding vectors modulo a number.
mod_add_mul
Implementations of ModAddMul and ModAddMulAssign, for adding a scalar multiple of one vector to another modulo a number.
mod_add_mul_shl
Implementations of ModAddMulShl and ModAddMulShlAssign, for adding a scalar multiple of one vector, shifted left, to another modulo a number.
mod_dot
Implementations of ModDot, the dot product of two vectors modulo a number, accumulating the sum before reducing it once.
mod_element_product
Implementations of ModElementProduct, the product of the elements modulo a number.
mod_element_sum
Implementations of ModElementSum, the sum of the elements modulo a number.
mod_is_reduced
An implementation of ModIsReduced, which checks whether every element of a vector is less than a given modulus.
mod_mul
Implementations of ModMul and ModMulAssign, for multiplying a vector by a scalar modulo a number.
mod_neg
Implementations of ModNeg and ModNegAssign, for negating a vector modulo a number.
mod_op
Implementations of Mod, ModAssign, Rem, and RemAssign, traits for reducing every element of a vector modulo a number.
mod_power_of_2
Implementations of ModPowerOf2 and ModPowerOf2Assign, which reduce every element of a vector modulo a power of 2.
mod_power_of_2_abs_squared
Implementations of ModPowerOf2AbsSquared, the squared norm of a vector modulo a power of 2.
mod_power_of_2_add
Implementations of ModPowerOf2Add and ModPowerOf2AddAssign, for adding vectors modulo a power of 2.
mod_power_of_2_add_mul
Implementations of ModPowerOf2AddMul and ModPowerOf2AddMulAssign, for adding a scalar multiple of one vector to another modulo a power of 2.
mod_power_of_2_add_mul_shl
Implementations of ModPowerOf2AddMulShl and ModPowerOf2AddMulShlAssign, for adding a scalar multiple of one vector, shifted left, to another modulo a power of 2.
mod_power_of_2_dot
Implementations of ModPowerOf2Dot, the dot product of two vectors modulo a power of 2.
mod_power_of_2_element_product
An implementation of ModPowerOf2ElementProduct, the product of the elements modulo a power of 2.
mod_power_of_2_element_sum
An implementation of ModPowerOf2ElementSum, the sum of the elements modulo a power of 2.
mod_power_of_2_is_reduced
An implementation of ModPowerOf2IsReduced, which checks whether every element of a vector is less than a given power of 2.
mod_power_of_2_mul
Implementations of ModPowerOf2Mul and ModPowerOf2MulAssign, for multiplying a vector by a scalar modulo a power of 2.
mod_power_of_2_neg
Implementations of ModPowerOf2Neg and ModPowerOf2NegAssign, for negating a vector modulo a power of 2.
mod_power_of_2_shl
Implementations of ModPowerOf2Shl and ModPowerOf2ShlAssign, for left-shifting a vector (multiplying it by a power of 2) modulo another power of 2.
mod_power_of_2_sub
Implementations of ModPowerOf2Sub and ModPowerOf2SubAssign, for subtracting vectors modulo a power of 2.
mod_power_of_2_sub_mul
Implementations of ModPowerOf2SubMul and ModPowerOf2SubMulAssign, for subtracting a scalar multiple of one vector from another modulo a power of 2.
mod_power_of_2_sub_mul_shl
Implementations of ModPowerOf2SubMulShl and ModPowerOf2SubMulShlAssign, for subtracting a scalar multiple of one vector, shifted left, from another modulo a power of 2.
mod_power_of_2_sum
Implementations of ModPowerOf2Sum, for adding up vectors entry by entry modulo a power of 2.
mod_shl
Implementations of ModShl and ModShlAssign, for left-shifting a vector (multiplying it by a power of 2) modulo a number.
mod_sub
Implementations of ModSub and ModSubAssign, for subtracting vectors modulo a number.
mod_sub_mul
Implementations of ModSubMul and ModSubMulAssign, for subtracting a scalar multiple of one vector from another modulo a number.
mod_sub_mul_shl
Implementations of ModSubMulShl and ModSubMulShlAssign, for subtracting a scalar multiple of one vector, shifted left, from another modulo a number.
mod_sum
Implementations of ModSum, for adding up vectors entry by entry modulo a number.
scalar_div
Implementations of Div and DivAssign, for dividing a vector by a scalar.
shr
Right-shifting a vector (dividing it by a power of 2 and taking the floor), by implementations of Shr and ShrAssign.