Versions in this module Expand all Collapse all v0 v0.1.1 Jul 13, 2026 Changes in this version + var ErrIndexOutOfRange = errors.New("fenwick: index out of range") + var ErrInvalidRange = errors.New("fenwick: invalid range") + type Float32 float32 + func (f Float32) Add(other Value) Value + func (f Float32) Sub(other Value) Value + func (f Float32) Zero() Value + type Float64 float64 + func (f Float64) Add(other Value) Value + func (f Float64) Sub(other Value) Value + func (f Float64) Zero() Value + type Int int + func (i Int) Add(other Value) Value + func (i Int) Sub(other Value) Value + func (i Int) Zero() Value + type Int64 int64 + func (i Int64) Add(other Value) Value + func (i Int64) Sub(other Value) Value + func (i Int64) Zero() Value + type Mutation struct + Index int + Kind MutationKind + Value T + func AddMutation[T any](index int, delta T) Mutation[T] + func SetMutation[T any](index int, value T) Mutation[T] + type MutationKind uint8 + const MutationAdd + const MutationSet + type Number interface + type NumericOperations struct + func (NumericOperations[T]) Add(a, b T) T + func (NumericOperations[T]) Sub(a, b T) T + func (NumericOperations[T]) Zero() T + type OperationFuncs struct + AddFunc func(a, b T) T + SubFunc func(a, b T) T + ZeroFunc func() T + func (f OperationFuncs[T]) Add(a, b T) T + func (f OperationFuncs[T]) Sub(a, b T) T + func (f OperationFuncs[T]) Zero() T + type Operations interface + Add func(a, b T) T + Sub func(a, b T) T + Zero func() T + type ShardedTree struct + func NewNumericShardedWithCount[T Number](values []T, shardCount int) *ShardedTree[T] + func NewNumericSharded[T Number](values []T) *ShardedTree[T] + func NewShardedWithCount[T Value](values []T, shardCount int) *ShardedTree[T] + func NewShardedWithOperationsAndCount[T any](values []T, shardCount int, ops Operations[T]) *ShardedTree[T] + func NewShardedWithOperations[T any](values []T, ops Operations[T]) *ShardedTree[T] + func NewSharded[T Value](values []T) *ShardedTree[T] + func (t *ShardedTree[T]) Add(index int, delta T) error + func (t *ShardedTree[T]) Apply(mutations ...Mutation[T]) error + func (t *ShardedTree[T]) At(index int) (T, error) + func (t *ShardedTree[T]) ExactPrefixSum(index int) (T, error) + func (t *ShardedTree[T]) ExactRangeSum(left, right int) (T, error) + func (t *ShardedTree[T]) ExactTotal() T + func (t *ShardedTree[T]) Len() int + func (t *ShardedTree[T]) PrefixSum(index int) (T, error) + func (t *ShardedTree[T]) RangeSum(left, right int) (T, error) + func (t *ShardedTree[T]) Set(index int, value T) error + func (t *ShardedTree[T]) ShardCount() int + func (t *ShardedTree[T]) Total() T + func (t *ShardedTree[T]) Values() []T + type Tree struct + func NewNumeric[T Number](values []T) *Tree[T] + func NewWithOperations[T any](values []T, ops Operations[T]) *Tree[T] + func New[T Value](values []T) *Tree[T] + func (t *Tree[T]) Add(index int, delta T) error + func (t *Tree[T]) Apply(mutations ...Mutation[T]) error + func (t *Tree[T]) At(index int) (T, error) + func (t *Tree[T]) Len() int + func (t *Tree[T]) PrefixSum(index int) (T, error) + func (t *Tree[T]) RangeSum(left, right int) (T, error) + func (t *Tree[T]) Set(index int, value T) error + func (t *Tree[T]) Total() T + func (t *Tree[T]) Values() []T + type Uint uint + func (u Uint) Add(other Value) Value + func (u Uint) Sub(other Value) Value + func (u Uint) Zero() Value + type Uint64 uint64 + func (u Uint64) Add(other Value) Value + func (u Uint64) Sub(other Value) Value + func (u Uint64) Zero() Value + type Value interface + Add func(other Value) Value + Sub func(other Value) Value + Zero func() Value v0.1.0 Jul 10, 2026