#array #2d #transpose

no-std transpose

Utility for transposing multi-dimensional data

3 unstable releases

Uses old Rust 2015

0.2.1 Mar 31, 2021
0.2.0 Jan 5, 2019
0.1.0 Jan 2, 2019

#33 in No standard library

Download history 2720/week @ 2021-01-21 2707/week @ 2021-01-28 3572/week @ 2021-02-04 3905/week @ 2021-02-11 3708/week @ 2021-02-18 3827/week @ 2021-02-25 3677/week @ 2021-03-04 3238/week @ 2021-03-11 3574/week @ 2021-03-18 3633/week @ 2021-03-25 2149/week @ 2021-04-01 3840/week @ 2021-04-08 4089/week @ 2021-04-15 3959/week @ 2021-04-22 3672/week @ 2021-04-29 3438/week @ 2021-05-06

14,077 downloads per month
Used in 54 crates (5 directly)

MIT/Apache

21KB
237 lines

transpose

crate license documentation minimum rustc 1.26

Utility for transposing multi-dimensional data See the API Documentation for more details.

transpose is #![no_std]

Example

// Create a 2D array in row-major order: the rows of our 2D array are contiguous,
// and the columns are strided
let input_array = vec![ 1, 2, 3,
                        4, 5, 6];

// Treat our 6-element array as a 2D 3x2 array, and transpose it to a 2x3 array
let mut output_array = vec![0; 6];
transpose::transpose(&input_array, &mut output_array, 3, 2);

// The rows have become the columns, and the columns have become the rows
let expected_array =  vec![ 1, 4,
                            2, 5,
                            3, 6];
assert_eq!(output_array, expected_array);

Compatibility

The transpose crate requires rustc 1.26 or greater.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~240KB