#plane #data-structure-2d #grid2d

plane-2d

Continuous 2D data structure representing infinite 2d plane

5 releases

0.1.4 Jun 14, 2024
0.1.3 Jun 14, 2024
0.1.2 Jun 13, 2024
0.1.1 Jun 11, 2024
0.1.0 Jun 10, 2024

#484 in Data structures

Download history 416/week @ 2024-06-10 21/week @ 2024-06-17

437 downloads per month

MIT/Apache

30KB
595 lines

Two Dimensional Plane

Continuous 2D data structure, infinitely big. The purpose of this crate is to provide a universal data structure that is faster than a naiveHashMap<(i32, i32), T> solution.

This crate will always provide a 2D data structure. If you need three or more dimensions take a look at the other libraries. The grid crate is a container for all kinds of data that implement Default trait. You can use Option<T> to store any kind of data. No other dependencies except for the std lib are used. Most of the functions std::Vec<T> offer are also implemented in grid and slightly modified for a 2D data object.

Memory layout

Uses grid crate to store a dense chunk of the grid and HashMap<(i32, i32), T> to store cells that are out of bounds of the Grid<T>


lib.rs:

Two Dimensional Plane

Continuous 2D data structure representing infinite 2d plane. The purpose of this crate is to provide a universal data structure that is faster than a naiveHashMap<(i32, i32), T> solution.

This crate will always provide a 2D data structure. If you need three or more dimensions take a look at the other libraries. The grid crate is a container for all kinds of data that implement Default trait. You can use Option<T> to store any kind of data. No other dependencies except for the std lib are used. Most of the functions std::Vec<T> offer are also implemented in grid and slightly modified for a 2D data object.

Memory layout

Uses grid crate to store a dense chunk of the grid and HashMap<(i32, i32), T> to store cells that are out of bounds of the [Grid<T>]

Dependencies

~115–285KB