Expand description
Module of operations that can be performed in a segment tree.
A segment tree needs some operation, and this module contains the main Operation
trait, together with the marker trait Commutative
. This module also contains
implementations for simple operations.
Structs§
- Add
- Each node contains the sum of the interval it represents.
- And
- Each node contains the bitwise and of the interval it represents.
- Max
- Each node contains the maximum of the interval it represents.
- MaxIgnore
NaN - Variant of
Max
that considers NaN the smallest value. - MaxTake
NaN - Variant of
Max
that considers NaN the largest value. - Min
- Each node contains the minimum of the interval it represents.
- MinIgnore
NaN - Variant of
Min
that considers NaN the largest value. - MinTake
NaN - Variant of
Min
that considers NaN the smallest value. - Mul
- Each node contains the product of the interval it represents.
- Or
- Each node contains the bitwise or of the interval it represents.
- Pair
- Store several pieces of information in each node.
- Xor
- Each node contains the bitwise xor of the interval it represents.
Traits§
- Commutative
- A marker trait that specifies that an
Operation
is commutative, that is:combine(a, b) = combine(b, a)
. - Identity
- A trait that specifies that this
Operation
has an identity element. - Invertible
- A trait for invertible operations.
- Operation
- A trait that specifies which associative operator to use in a segment tree.