pub struct Xnor;Expand description
The fold of integers by bitwise XNOR, !(a ^ b), and of Booleans by ==: true where an even number of them are false.
Trait Implementations§
Source§impl Binary<bool> for Xnor
impl Binary<bool> for Xnor
fn one(&self, x: bool, y: bool) -> bool
fn judged(&self, x: bool, y: bool) -> (bool, bool)
fn slice( &self, args: [Arg<'_, bool>; 2], n: usize, out: &mut [MaybeUninit<bool>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
impl Copy for Xnor
Source§impl Formula<2> for Xnor
impl Formula<2> for Xnor
const BOOLEAN: bool = true
Source§const INTEGER_FORMULA: bool = true
const INTEGER_FORMULA: bool = true
Whether
integer runs this formula’s emit on integers, so that range arithmetic over emit_valid bounds an integer kernel’s failures (may_raise). A row with a native_integer body supports integers and leaves this false.fn fold(&self) -> Option<Reduce>
Source§fn truth_table(&self) -> Option<u8>
fn truth_table(&self) -> Option<u8>
The function’s results on Booleans, as bits: bit
2x+y for two arguments, bit x for one. A Boolean kernel computes by it (operation::map_truth).fn supports(&self, dtype: DType) -> bool
fn emit_test<F, O>( &self, o: &O, _: [<O as Ops<F>>::V; 2], ) -> Option<<O as Ops<F>>::B>
fn integer<I>(&self, o: &IntegerOps<I>, x: [I; 2]) -> Option<I>where
I: Overflowing,
fn emit_valid<F, O>( &self, v: Variant, o: &O, x: [<O as Ops<F>>::V; 2], _: <O as Ops<F>>::V, ) -> Option<(Kind, <O as Ops<F>>::B)>
fn native_slices(&self) -> Option<NativeSlices<Xnor, 2>>
Source§const FAILS_NAN: bool = false
const FAILS_NAN: bool = false
Whether a NaN result from arguments that aren’t NaN is a Domain error, which the default
emit_valid checks (nan_valid). A constant, so a checked loop over items reads it at compile time and never calls a method for it.Source§const MAP_ONLY: bool = false
const MAP_ONLY: bool = false
Whether kernels of this formula only map. Modified writes, folds, scans and walks of adjacent items build no code for it: each refuses it at compile time, as it refuses a formula of another arity. A derivative’s slope (
derivative::Slope) only maps.fn result_dtype(&self, input: DType) -> DType
fn computing_dtype(&self, input: DType) -> Option<DType>
fn character_rule(&self) -> Option<Rule>
fn ordered_kinds(&self, _: [i32; 2]) -> Option<i32>
fn character_policy(&self, types: [DType; 2]) -> Result<Option<Policy>, Error>
fn exact( &self, _args: [&Ratio<BigInt>; N], ) -> Result<Option<Ratio<BigInt>>, Error>
fn range(&self, _args: [Range; N]) -> Range
Source§fn domain(&self, _dtype: DType, _args: [Range; N]) -> Option<[Range; N]>
fn domain(&self, _dtype: DType, _args: [Range; N]) -> Option<[Range; N]>
A box at the computing dtype containing args on which graph-numeric results do not raise a data error.
fn identity(&self) -> [Option<f64>; N]
fn inverse_fold(&self) -> Option<Reduce>
fn truth(&self) -> Option<Reduce>
Source§fn same(&self, _arg: Range) -> Option<Range>
fn same(&self, _arg: Range) -> Option<Range>
Refines the real result interval when both operands denote the same value.
fn reads(&self) -> Reads
fn emit<F, O>( &self, _o: &O, _x: [<O as Ops<F>>::V; N], ) -> Option<<O as Ops<F>>::V>
Source§fn emit_against<F, O>(
&self,
_o: &O,
_c: F,
_v: <O as Ops<F>>::V,
_left: bool,
) -> Option<<O as Ops<F>>::B>
fn emit_against<F, O>( &self, _o: &O, _c: F, _v: <O as Ops<F>>::V, _left: bool, ) -> Option<<O as Ops<F>>::B>
This comparison of
v with the one number c through o, where that has a cheaper recipe than comparing item by item, as a held constant has. left says whether v is the left argument. None for other formulas.Source§fn bands(&self) -> Option<(Tolerance, Band, Band)>
fn bands(&self) -> Option<(Tolerance, Band, Band)>
This comparison’s tolerance, and the bands that an item on the left and on the right of one number must lie in (
tolerant::Banding), through which it compares many items with one number (tolerant::against). None for other formulas.fn emit_repair<F, O>( &self, _o: &O, _x: [<O as Ops<F>>::V; N], ) -> Option<<O as Ops<F>>::B>
fn repair_routine(&self) -> Option<Repair>
fn real<F>(
&self,
ops: &NativeOps<rustymath_core::::facts::Formula::real::{constant#0}>,
x: [F; N],
) -> Option<F>where
F: Native,
fn complex<F>(
&self,
_ops: &NativeOps<rustymath_core::::facts::Formula::complex::{constant#0}>,
_x: [Complex<F>; N],
) -> Option<Complex<F>>where
F: Native,
Source§const REAL_COMPLEX: bool = false
const REAL_COMPLEX: bool = false
Whether
real_complex gives this formula’s complex results from real arguments.Source§fn real_complex<F>(
&self,
_ops: &NativeOps<rustymath_core::::facts::Formula::real_complex::{constant#0}>,
_x: [F; N],
) -> Option<Complex<F>>where
F: Native,
fn real_complex<F>(
&self,
_ops: &NativeOps<rustymath_core::::facts::Formula::real_complex::{constant#0}>,
_x: [F; N],
) -> Option<Complex<F>>where
F: Native,
The complex result from real arguments, where that costs less than from the arguments as complex numbers.
None sends the item to complex.fn emit_partials<F, O>( &self, _o: &O, _x: [<O as Ops<F>>::V; N], _result: <O as Ops<F>>::V, _needed: [bool; N], ) -> [Option<<O as Ops<F>>::V>; N]
Source§impl Reduction<bool> for Xnor
impl Reduction<bool> for Xnor
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = bool
type Total = bool
The type of a fold: the item type,
i64 for a sum or product of integers narrower than 64 bits, f32 for a sum or product of f16s, i16 for an XNOR of bytes, the C of SumAs, f64 for Squares, a Scaled product for ScaledProduct, or a total with the parity of its count for Alternated.Source§fn unit() -> bool
fn unit() -> bool
The fold of no items: 0, 1, -∞ or ∞, the integer type’s least or greatest value, all ones, or false or true.
Source§fn merge(a: bool, b: bool) -> (bool, bool)
fn merge(a: bool, b: bool) -> (bool, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[bool]) -> (bool, bool)
fn slice(x: &[bool]) -> (bool, bool)
The fold of
x, which is unit() where x is empty, and whether it fits. The default takes each item in turn by checked.Source§fn scan(x: &[bool], start: Option<bool>, out: &mut Vec<bool>) -> bool
fn scan(x: &[bool], start: Option<bool>, out: &mut Vec<bool>) -> bool
Appends the running folds of
x to out, the first combining start where it is given, and gives whether every one fits. The default takes each item in turn by checked (checked_steps).Source§fn short_lanes(
data: &[bool],
len: usize,
start: Option<bool>,
out: &mut Vec<bool>,
) -> Option<bool>
fn short_lanes( data: &[bool], len: usize, start: Option<bool>, out: &mut Vec<bool>, ) -> Option<bool>
Appends the running folds of
data’s lanes of len consecutive items to out, each lane from start, through a route that runs many short lanes at once, and gives whether every fold fits. A reduction without such a route gives None and appends nothing, as the default does. scan_along then runs the lanes itself. The Boolean reductions run lanes of 1 to 64 items through Logical, 64 items to a word.Source§fn identity() -> Self::Total
fn identity() -> Self::Total
The exact identity of
step, which leaves every total unchanged. For float sums it’s -0.0, because adding unit(), 0.0, turns a total of -0.0 into 0.0. For every other reduction it’s unit().Source§fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
step, and whether its result fits. An integer sum or product wraps where it doesn’t.Source§fn one(x: T) -> (Self::Total, bool)
fn one(x: T) -> (Self::Total, bool)
The fold of the one item
x, checked(identity(), x), and whether it fits.Source§fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
merge, for a chain of folds whose every step waits for the one before, as van Herk-Gil-Werman’s suffixes and prefixes do. As in merge, a folds the earlier items. Float maximums and minimums override it with Folds::step_max and step_min, which use AArch64’s one-instruction fmaxnm and fminnm. LLVM can’t vectorize those, so they stay out of merge.Source§fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
Folds each row of
data, a matrix with columns items in each row, into the matching item of out, and gives whether every fold fits. The default is fold_rows, which folds each row of 16 items or more by slice. Float sums and products, integer maximums and minimums, and bitwise folds fold rows of 16 to 63 items by checked instead, eight rows side by side (rows_side_by_side). Each of their steps is one instruction, so keeping several rows’ steps in flight costs less than a call of slice for each row. Other reductions keep fold_rows, where slice vectorizes within the row: an integer sum’s step checks for overflow, and a float maximum’s or minimum’s slice runs Folds’ vector kernels. Nobody has timed float maximums side by side since their step became one select on x86.Source§const SPLIT: usize = 8
const SPLIT: usize = 8
The most classes for which
crate::search::ClassNumbers folds each class into four totals by position. Each step of a class’s total waits on the last through memory, so a reduction whose step takes longer gains from the split over more classes.Source§impl Reduction<i16> for Xnor
impl Reduction<i16> for Xnor
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = i16
type Total = i16
The type of a fold: the item type,
i64 for a sum or product of integers narrower than 64 bits, f32 for a sum or product of f16s, i16 for an XNOR of bytes, the C of SumAs, f64 for Squares, a Scaled product for ScaledProduct, or a total with the parity of its count for Alternated.Source§fn unit() -> i16
fn unit() -> i16
The fold of no items: 0, 1, -∞ or ∞, the integer type’s least or greatest value, all ones, or false or true.
Source§fn merge(a: i16, b: i16) -> (i16, bool)
fn merge(a: i16, b: i16) -> (i16, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[i16]) -> (i16, bool)
fn slice(x: &[i16]) -> (i16, bool)
The fold of
x, which is unit() where x is empty, and whether it fits. The default takes each item in turn by checked.Source§fn scan(x: &[i16], start: Option<i16>, out: &mut Vec<i16>) -> bool
fn scan(x: &[i16], start: Option<i16>, out: &mut Vec<i16>) -> bool
Appends the running folds of
x to out, the first combining start where it is given, and gives whether every one fits. The default takes each item in turn by checked (checked_steps).Source§fn rows(data: &[i16], columns: usize, out: &mut [i16]) -> bool
fn rows(data: &[i16], columns: usize, out: &mut [i16]) -> bool
Folds each row of
data, a matrix with columns items in each row, into the matching item of out, and gives whether every fold fits. The default is fold_rows, which folds each row of 16 items or more by slice. Float sums and products, integer maximums and minimums, and bitwise folds fold rows of 16 to 63 items by checked instead, eight rows side by side (rows_side_by_side). Each of their steps is one instruction, so keeping several rows’ steps in flight costs less than a call of slice for each row. Other reductions keep fold_rows, where slice vectorizes within the row: an integer sum’s step checks for overflow, and a float maximum’s or minimum’s slice runs Folds’ vector kernels. Nobody has timed float maximums side by side since their step became one select on x86.Source§fn identity() -> Self::Total
fn identity() -> Self::Total
The exact identity of
step, which leaves every total unchanged. For float sums it’s -0.0, because adding unit(), 0.0, turns a total of -0.0 into 0.0. For every other reduction it’s unit().Source§fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
step, and whether its result fits. An integer sum or product wraps where it doesn’t.Source§fn one(x: T) -> (Self::Total, bool)
fn one(x: T) -> (Self::Total, bool)
The fold of the one item
x, checked(identity(), x), and whether it fits.Source§fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
merge, for a chain of folds whose every step waits for the one before, as van Herk-Gil-Werman’s suffixes and prefixes do. As in merge, a folds the earlier items. Float maximums and minimums override it with Folds::step_max and step_min, which use AArch64’s one-instruction fmaxnm and fminnm. LLVM can’t vectorize those, so they stay out of merge.Source§fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
Appends the running folds of
data’s lanes of len consecutive items to out, each lane from start, through a route that runs many short lanes at once, and gives whether every fold fits. A reduction without such a route gives None and appends nothing, as the default does. scan_along then runs the lanes itself. The Boolean reductions run lanes of 1 to 64 items through Logical, 64 items to a word.Source§const SPLIT: usize = 8
const SPLIT: usize = 8
The most classes for which
crate::search::ClassNumbers folds each class into four totals by position. Each step of a class’s total waits on the last through memory, so a reduction whose step takes longer gains from the split over more classes.Source§impl Reduction<i32> for Xnor
impl Reduction<i32> for Xnor
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = i32
type Total = i32
The type of a fold: the item type,
i64 for a sum or product of integers narrower than 64 bits, f32 for a sum or product of f16s, i16 for an XNOR of bytes, the C of SumAs, f64 for Squares, a Scaled product for ScaledProduct, or a total with the parity of its count for Alternated.Source§fn unit() -> i32
fn unit() -> i32
The fold of no items: 0, 1, -∞ or ∞, the integer type’s least or greatest value, all ones, or false or true.
Source§fn merge(a: i32, b: i32) -> (i32, bool)
fn merge(a: i32, b: i32) -> (i32, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[i32]) -> (i32, bool)
fn slice(x: &[i32]) -> (i32, bool)
The fold of
x, which is unit() where x is empty, and whether it fits. The default takes each item in turn by checked.Source§fn scan(x: &[i32], start: Option<i32>, out: &mut Vec<i32>) -> bool
fn scan(x: &[i32], start: Option<i32>, out: &mut Vec<i32>) -> bool
Appends the running folds of
x to out, the first combining start where it is given, and gives whether every one fits. The default takes each item in turn by checked (checked_steps).Source§fn rows(data: &[i32], columns: usize, out: &mut [i32]) -> bool
fn rows(data: &[i32], columns: usize, out: &mut [i32]) -> bool
Folds each row of
data, a matrix with columns items in each row, into the matching item of out, and gives whether every fold fits. The default is fold_rows, which folds each row of 16 items or more by slice. Float sums and products, integer maximums and minimums, and bitwise folds fold rows of 16 to 63 items by checked instead, eight rows side by side (rows_side_by_side). Each of their steps is one instruction, so keeping several rows’ steps in flight costs less than a call of slice for each row. Other reductions keep fold_rows, where slice vectorizes within the row: an integer sum’s step checks for overflow, and a float maximum’s or minimum’s slice runs Folds’ vector kernels. Nobody has timed float maximums side by side since their step became one select on x86.Source§fn identity() -> Self::Total
fn identity() -> Self::Total
The exact identity of
step, which leaves every total unchanged. For float sums it’s -0.0, because adding unit(), 0.0, turns a total of -0.0 into 0.0. For every other reduction it’s unit().Source§fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
step, and whether its result fits. An integer sum or product wraps where it doesn’t.Source§fn one(x: T) -> (Self::Total, bool)
fn one(x: T) -> (Self::Total, bool)
The fold of the one item
x, checked(identity(), x), and whether it fits.Source§fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
merge, for a chain of folds whose every step waits for the one before, as van Herk-Gil-Werman’s suffixes and prefixes do. As in merge, a folds the earlier items. Float maximums and minimums override it with Folds::step_max and step_min, which use AArch64’s one-instruction fmaxnm and fminnm. LLVM can’t vectorize those, so they stay out of merge.Source§fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
Appends the running folds of
data’s lanes of len consecutive items to out, each lane from start, through a route that runs many short lanes at once, and gives whether every fold fits. A reduction without such a route gives None and appends nothing, as the default does. scan_along then runs the lanes itself. The Boolean reductions run lanes of 1 to 64 items through Logical, 64 items to a word.Source§const SPLIT: usize = 8
const SPLIT: usize = 8
The most classes for which
crate::search::ClassNumbers folds each class into four totals by position. Each step of a class’s total waits on the last through memory, so a reduction whose step takes longer gains from the split over more classes.Source§impl Reduction<i64> for Xnor
impl Reduction<i64> for Xnor
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = i64
type Total = i64
The type of a fold: the item type,
i64 for a sum or product of integers narrower than 64 bits, f32 for a sum or product of f16s, i16 for an XNOR of bytes, the C of SumAs, f64 for Squares, a Scaled product for ScaledProduct, or a total with the parity of its count for Alternated.Source§fn unit() -> i64
fn unit() -> i64
The fold of no items: 0, 1, -∞ or ∞, the integer type’s least or greatest value, all ones, or false or true.
Source§fn merge(a: i64, b: i64) -> (i64, bool)
fn merge(a: i64, b: i64) -> (i64, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[i64]) -> (i64, bool)
fn slice(x: &[i64]) -> (i64, bool)
The fold of
x, which is unit() where x is empty, and whether it fits. The default takes each item in turn by checked.Source§fn scan(x: &[i64], start: Option<i64>, out: &mut Vec<i64>) -> bool
fn scan(x: &[i64], start: Option<i64>, out: &mut Vec<i64>) -> bool
Appends the running folds of
x to out, the first combining start where it is given, and gives whether every one fits. The default takes each item in turn by checked (checked_steps).Source§fn rows(data: &[i64], columns: usize, out: &mut [i64]) -> bool
fn rows(data: &[i64], columns: usize, out: &mut [i64]) -> bool
Folds each row of
data, a matrix with columns items in each row, into the matching item of out, and gives whether every fold fits. The default is fold_rows, which folds each row of 16 items or more by slice. Float sums and products, integer maximums and minimums, and bitwise folds fold rows of 16 to 63 items by checked instead, eight rows side by side (rows_side_by_side). Each of their steps is one instruction, so keeping several rows’ steps in flight costs less than a call of slice for each row. Other reductions keep fold_rows, where slice vectorizes within the row: an integer sum’s step checks for overflow, and a float maximum’s or minimum’s slice runs Folds’ vector kernels. Nobody has timed float maximums side by side since their step became one select on x86.Source§fn identity() -> Self::Total
fn identity() -> Self::Total
The exact identity of
step, which leaves every total unchanged. For float sums it’s -0.0, because adding unit(), 0.0, turns a total of -0.0 into 0.0. For every other reduction it’s unit().Source§fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
step, and whether its result fits. An integer sum or product wraps where it doesn’t.Source§fn one(x: T) -> (Self::Total, bool)
fn one(x: T) -> (Self::Total, bool)
The fold of the one item
x, checked(identity(), x), and whether it fits.Source§fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
merge, for a chain of folds whose every step waits for the one before, as van Herk-Gil-Werman’s suffixes and prefixes do. As in merge, a folds the earlier items. Float maximums and minimums override it with Folds::step_max and step_min, which use AArch64’s one-instruction fmaxnm and fminnm. LLVM can’t vectorize those, so they stay out of merge.Source§fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
Appends the running folds of
data’s lanes of len consecutive items to out, each lane from start, through a route that runs many short lanes at once, and gives whether every fold fits. A reduction without such a route gives None and appends nothing, as the default does. scan_along then runs the lanes itself. The Boolean reductions run lanes of 1 to 64 items through Logical, 64 items to a word.Source§const SPLIT: usize = 8
const SPLIT: usize = 8
The most classes for which
crate::search::ClassNumbers folds each class into four totals by position. Each step of a class’s total waits on the last through memory, so a reduction whose step takes longer gains from the split over more classes.Source§impl Reduction<u8> for Xnor
Xnor of bytes, totalled at i16. Each total lies between -256 and 255, and the XNOR of two bytes is negative.
impl Reduction<u8> for Xnor
Xnor of bytes, totalled at i16. Each total lies between -256 and 255, and the XNOR of two bytes is negative.
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = i16
type Total = i16
The type of a fold: the item type,
i64 for a sum or product of integers narrower than 64 bits, f32 for a sum or product of f16s, i16 for an XNOR of bytes, the C of SumAs, f64 for Squares, a Scaled product for ScaledProduct, or a total with the parity of its count for Alternated.Source§fn unit() -> i16
fn unit() -> i16
The fold of no items: 0, 1, -∞ or ∞, the integer type’s least or greatest value, all ones, or false or true.
Source§fn merge(a: i16, b: i16) -> (i16, bool)
fn merge(a: i16, b: i16) -> (i16, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[u8]) -> (i16, bool)
fn slice(x: &[u8]) -> (i16, bool)
The fold of
x, which is unit() where x is empty, and whether it fits. The default takes each item in turn by checked.Source§fn scan(x: &[u8], start: Option<i16>, out: &mut Vec<i16>) -> bool
fn scan(x: &[u8], start: Option<i16>, out: &mut Vec<i16>) -> bool
Appends the running folds of
x to out, the first combining start where it is given, and gives whether every one fits. The default takes each item in turn by checked (checked_steps).Source§fn rows(data: &[u8], columns: usize, out: &mut [i16]) -> bool
fn rows(data: &[u8], columns: usize, out: &mut [i16]) -> bool
Folds each row of
data, a matrix with columns items in each row, into the matching item of out, and gives whether every fold fits. The default is fold_rows, which folds each row of 16 items or more by slice. Float sums and products, integer maximums and minimums, and bitwise folds fold rows of 16 to 63 items by checked instead, eight rows side by side (rows_side_by_side). Each of their steps is one instruction, so keeping several rows’ steps in flight costs less than a call of slice for each row. Other reductions keep fold_rows, where slice vectorizes within the row: an integer sum’s step checks for overflow, and a float maximum’s or minimum’s slice runs Folds’ vector kernels. Nobody has timed float maximums side by side since their step became one select on x86.Source§fn identity() -> Self::Total
fn identity() -> Self::Total
The exact identity of
step, which leaves every total unchanged. For float sums it’s -0.0, because adding unit(), 0.0, turns a total of -0.0 into 0.0. For every other reduction it’s unit().Source§fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
step, and whether its result fits. An integer sum or product wraps where it doesn’t.Source§fn one(x: T) -> (Self::Total, bool)
fn one(x: T) -> (Self::Total, bool)
The fold of the one item
x, checked(identity(), x), and whether it fits.Source§fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
merge, for a chain of folds whose every step waits for the one before, as van Herk-Gil-Werman’s suffixes and prefixes do. As in merge, a folds the earlier items. Float maximums and minimums override it with Folds::step_max and step_min, which use AArch64’s one-instruction fmaxnm and fminnm. LLVM can’t vectorize those, so they stay out of merge.Source§fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
Appends the running folds of
data’s lanes of len consecutive items to out, each lane from start, through a route that runs many short lanes at once, and gives whether every fold fits. A reduction without such a route gives None and appends nothing, as the default does. scan_along then runs the lanes itself. The Boolean reductions run lanes of 1 to 64 items through Logical, 64 items to a word.Source§const SPLIT: usize = 8
const SPLIT: usize = 8
The most classes for which
crate::search::ClassNumbers folds each class into four totals by position. Each step of a class’s total waits on the last through memory, so a reduction whose step takes longer gains from the split over more classes.Auto Trait Implementations§
impl Forget for Xnor
impl Freeze for Xnor
impl RefUnwindSafe for Xnor
impl Send for Xnor
impl Sync for Xnor
impl Unpin for Xnor
impl UnsafeUnpin for Xnor
impl UnwindSafe for Xnor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more