Minor README changes

- Typo fixes
- Added proper dependency syntax
- Used actual :idk: emoji
- Rephrased some descriptions
This commit is contained in:
Dzuchun 2024-11-16 16:49:20 +02:00
commit eb8a8714e7

View file

@ -15,7 +15,7 @@ This crate will presumably become obsolete, once const generics are introduced,
```toml
# Cargo.toml
[dependencies]
generic-array-storage = { git = "/* git ref here */" }
generic-array-storage = { git = "https://github.com/Dzuchun/generic_array_storage.git" }
```
# Contribution
@ -26,7 +26,7 @@ Just open an issue/PR or something. I'm happy to discuss any additions/fixes!
## What is `typenum`?
[`typenum`] implements integer operations as types. Basically, it allows for const arithmetic through same sort of trait wizardry, or something :idk:.
[`typenum`] implements integer operations as types. Basically, it allows for const arithmetic through same sort of trait wizardry, or something 🤷.
The takeaway is:
@ -44,7 +44,7 @@ etc
## What is `generic_array`?
[`generic_array`] implements arrays sized via `ArrayLength` trait implementors. Namely, it is implemented for `typenum` types, allowing creating an array sized as sum of two other arrays:
[`generic_array`] implements arrays sized via `ArrayLength` trait implementors. Namely, it is implemented for `typenum` types, allowing creation an arrays sized as sum of two other arrays:
```rust
# use generic_array::{sequence::Concat, GenericArray};
@ -53,7 +53,7 @@ let arr1: [i32; 3] = [1, 2, 3];
let arr2: [i32; 2] = [3, 5];
// some less-normal `generic_array` arrays
// (but having the same size and still allocated on stack)
// (but having the same size and still stack-allocated)
let garr1 = GenericArray::from_array(arr1);
let garr2 = GenericArray::from_array(arr2);
@ -65,19 +65,19 @@ let concat: [i32; 5] = garr_concat.into_array();
// let concat: [i32; 6] = garr_concat.into_array(); // <-- does not compile!
```
Coolest thing is - this code is panic-free, and fully statically checked, and missized arrays will result in compilation error.
Coolest thing is - this code is panic-free, fully statically checked, and missized arrays will result in compilation error.
## What is `nalgebra`?
[`nalgebra`] is matrix manipulation library, abstracted over type actually storing matrix elements. This allows for efficient matrix storing, if their dimension(s) are statically known.
[`nalgebra`] is a matrix manipulation library, abstracted over type actually storing the elements. This allows matrices to be automatically stored on stock, if their dimensions can be inferred at compile-time.
Generally, to store matrix on a stack entirely, you'll need for both of it's dimensions to be known, like `nalgrabra::U2` or `nalgebra::U3`. Unfortunately, default storage provided by `nalgebra` has a `const usize` type parameters, so they can't be used in case of sizes provided by associated constants.
## What is `generic_array_storage`?
This crate provides implementation of traits defining `nalgebra` storage backed up by `generic_array` arrays. This allows creation of matrices having dimensions backed up by `typenum`.
This crate provides implementation of traits defining `nalgebra` storage backed up by `generic_array` arrays. This allows creation of matrices having dimensions fully expressed as types, completely removing need for `const usize`.
For ease of use, there's a `GenericMatrix` type alias, and `GenericMatrixExt` extension trait, providing convenient type interface and conversion functions respectively. Note that `GenericMatrix` is an alias to `nalgebra::Matrix`, so all of the functions provided by `nalgebra` are generally supported.
For ease of use, there's a `GenericMatrix` type alias, and `GenericMatrixExt` extension trait, providing convenient type interface and conversion functions respectively. Note that `GenericMatrix` is an alias to `nalgebra::Matrix`, so all of the functions provided by `nalgebra` are expected to be supported.
[`nalgebra`]: https://docs.rs/nalgebra/latest/nalgebra
[`generic_array`]: https://docs.rs/generic-array/latest/generic_array