Module segment_tree::ops

source ·
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

Each node contains the sum of the interval it represents.
Each node contains the bitwise and of the interval it represents.
Each node contains the maximum of the interval it represents.
Variant of Max that considers NaN the smallest value.
Variant of Max that considers NaN the largest value.
Each node contains the minimum of the interval it represents.
Variant of Min that considers NaN the largest value.
Variant of Min that considers NaN the smallest value.
Each node contains the product of the interval it represents.
Each node contains the bitwise or of the interval it represents.
Store several pieces of information in each node.
Each node contains the bitwise xor of the interval it represents.

Traits

A marker trait that specifies that an Operation is commutative, that is: combine(a, b) = combine(b, a).
A trait that specifies that this Operation has an identity element.
A trait for invertible operations.
A trait that specifies which associative operator to use in a segment tree.