Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

1
vendor/grid/.cargo-checksum.json vendored Normal file
View File

@@ -0,0 +1 @@
{"files":{"Cargo.toml":"d256c6b71fb14cbf029e03adeb94a16d3250f6fcacb99181bb30542a79d4c04e","LICENSE":"965116a3d1e412221d5ff2e58edfab30a62fe112f0f6bf13136a946907869da9","README.md":"7291a0c7fce70323458500e07eb8822213a851600d8b00aef45b05c1209929fb","benches/benches.rs":"077aeaefa409c41ab96560d71682eadc19dc072d34c9b68534d90ec678c90b6d","src/lib.rs":"f8e2408a499ac7a222c46fae189fe84155c34c3fd703d42de5e7662160831cad"},"package":"36119f3a540b086b4e436bb2b588cf98a68863470e0e880f4d0842f112a3183a"}

65
vendor/grid/Cargo.toml vendored Normal file
View File

@@ -0,0 +1,65 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2018"
name = "grid"
version = "0.15.0"
authors = ["Armin Becher <armin.becher@gmai.com>"]
description = "Dynamic generic 2D data structure."
documentation = "https://docs.rs/grid"
readme = "README.md"
keywords = [
"2D",
"array",
"matrix",
"data-structure",
"2D-vector",
]
categories = [
"science",
"data-structures",
]
license = "MIT"
repository = "https://github.com/becheran/grid"
[[bench]]
name = "benches"
harness = false
[dependencies.serde]
version = "1.0.188"
features = ["derive"]
optional = true
[dev-dependencies.criterion]
version = "0.3.6"
[dev-dependencies.rand]
version = "0.8.5"
[dev-dependencies.serde_json]
version = "1.0.106"
[features]
default = ["std"]
serde = [
"std",
"dep:serde",
]
std = []
[badges.gitlab]
branch = "master"
repository = "becheran/grid_ci"
[badges.maintenance]
status = "actively-developed"

21
vendor/grid/LICENSE vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Armin Becher
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

19
vendor/grid/README.md vendored Normal file
View File

@@ -0,0 +1,19 @@
# Grid
[![docs](https://docs.rs/grid/badge.svg)](https://docs.rs/grid)
[![crates.io](https://badgen.net/crates/d/grid)](https://crates.io/crates/grid)
[![build status](https://github.com/becheran/grid/actions/workflows/rust.yml/badge.svg)](https://github.com/becheran/grid/actions)
[![license](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Data structure grid for rust. Provide a two dimensional data structure for rust that is easy to use and fast.
Most of the functionality provided by the [std::vec::Vec](https://doc.rust-lang.org/std/vec/struct.Vec.html) type for one dimensional vectors
is implemented for two dimensions in this crate.
To use *grid* with *no_std* import the library such as:
``` toml
grid = { version = "*", default-features = false }
```
- [documentation](https://docs.rs/grid/)
- [library on crates.io](https://crates.io/crates/grid)

207
vendor/grid/benches/benches.rs vendored Normal file
View File

@@ -0,0 +1,207 @@
use criterion::{criterion_group, criterion_main, Criterion};
use grid::grid;
use grid::Grid;
use rand::Rng;
const SIZE: usize = 1_000;
fn init_vec_vec() -> Vec<Vec<u8>> {
vec![vec![0; SIZE]; SIZE]
}
fn init_grid() -> Grid<u8> {
Grid::init(SIZE, SIZE, 0)
}
fn criterion_benchmark(c: &mut Criterion) {
let mut rng = rand::thread_rng();
let mut rand = || rng.gen_range(0..SIZE);
// Init macro
c.bench_function("vecvec_init_macro", |b| {
b.iter(|| {
vec![
vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
]
})
});
c.bench_function("grid_init_macro", |b| {
b.iter(|| {
grid![[0,1,2,3,4,5,6,7,8,9]
[0,1,2,3,4,5,6,7,8,9]
[0,1,2,3,4,5,6,7,8,9]
[0,1,2,3,4,5,6,7,8,9]
[0,1,2,3,4,5,6,7,8,9]
[0,1,2,3,4,5,6,7,8,9]
[0,1,2,3,4,5,6,7,8,9]
[0,1,2,3,4,5,6,7,8,9]
[0,1,2,3,4,5,6,7,8,9]
[0,1,2,3,4,5,6,7,8,9]]
})
});
c.bench_function("grid_from_vec", |b| {
b.iter(|| {
let vec = vec![
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3,
4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
];
Grid::from_vec(vec, 10)
})
});
// Constructor
c.bench_function("vecvec_init", |b| b.iter(|| vec![vec![0; SIZE]; SIZE]));
c.bench_function("grid_init", |b| b.iter(|| Grid::init(SIZE, SIZE, 0)));
// Index
c.bench_function("vecvec_idx", |b| {
let vec_vec = init_vec_vec();
b.iter_batched(
|| (rand(), rand()),
|(x, y)| {
let _v = vec_vec[x][y];
},
criterion::BatchSize::SmallInput,
)
});
c.bench_function("grid_idx", |b| {
let grid = init_grid();
b.iter_batched(
|| (rand(), rand()),
|(x, y)| grid[(x, y)],
criterion::BatchSize::SmallInput,
)
});
c.bench_function("vecvec_get", |b| {
let vec_vec = init_vec_vec();
b.iter_batched(
|| (rand(), rand()),
|(x, y)| {
let _v = vec_vec.get(x).unwrap().get(y).unwrap();
},
criterion::BatchSize::SmallInput,
)
});
c.bench_function("grid_get", |b| {
let grid = init_grid();
b.iter_batched(
|| (rand(), rand()),
|(x, y)| {
let _v = grid.get(x, y).unwrap();
},
criterion::BatchSize::SmallInput,
)
});
//Set
c.bench_function("vecvec_set", |b| {
let mut vec_vec = init_vec_vec();
b.iter_batched(
|| (rand(), rand()),
|(x, y)| vec_vec[x][y] = 42,
criterion::BatchSize::SmallInput,
)
});
c.bench_function("grid_set", |b| {
let mut g = init_grid();
b.iter_batched(
|| (rand(), rand()),
|(x, y)| g[(x, y)] = 42,
criterion::BatchSize::SmallInput,
)
});
// Push
c.bench_function("grid_push_row", |b| {
let grid = init_grid();
b.iter_batched(
|| grid.clone(),
|mut g| g.push_row(vec![0; SIZE]),
criterion::BatchSize::SmallInput,
)
});
c.bench_function("grid_push_col", |b| {
let grid = init_grid();
b.iter_batched(
|| grid.clone(),
|mut g| g.push_col(vec![0; SIZE]),
criterion::BatchSize::SmallInput,
)
});
// Pop
c.bench_function("grid_pop_row", |b| {
let grid = init_grid();
b.iter_batched(
|| grid.clone(),
|mut g| g.pop_row(),
criterion::BatchSize::SmallInput,
)
});
c.bench_function("grid_pop_col", |b| {
let grid = init_grid();
b.iter_batched(
|| grid.clone(),
|mut g| g.pop_col(),
criterion::BatchSize::SmallInput,
)
});
// Remove
c.bench_function("grid_remove_row", |b| {
let grid = init_grid();
b.iter_batched(
|| grid.clone(),
|mut g| g.remove_row(2),
criterion::BatchSize::SmallInput,
)
});
c.bench_function("grid_remove_col", |b| {
let grid = init_grid();
b.iter_batched(
|| grid.clone(),
|mut g| g.remove_col(2),
criterion::BatchSize::SmallInput,
)
});
// Rotation
c.bench_function("grid_rotate_left", |b| {
let grid = init_grid();
b.iter_batched(
|| grid.clone(),
|mut g| g.rotate_left(),
criterion::BatchSize::SmallInput,
)
});
c.bench_function("grid_rotate_right", |b| {
let grid = init_grid();
b.iter_batched(
|| grid.clone(),
|mut g| g.rotate_right(),
criterion::BatchSize::SmallInput,
)
});
c.bench_function("grid_rotate_half", |b| {
let grid = init_grid();
b.iter_batched(
|| grid.clone(),
|mut g| g.rotate_half(),
criterion::BatchSize::SmallInput,
)
});
}
criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);

3532
vendor/grid/src/lib.rs vendored Normal file

File diff suppressed because it is too large Load Diff