Skip to main content

2 docs tagged with "matrices"

View all tags

Matrix Toolbox

Handy Python snippets and patterns for working with 2D grids and matrices: initialization, bounds checking, neighbor offsets, and n-distance neighbors.

Prefix Sums

Prefix sums (cumulative sums) are a foundational technique for speeding up range queries. They extend beyond arrays into matrices, trees, and even XOR or product computations, forming the backbone of many algorithmic optimizations.