denyhosts/clamav/libclamav_rust/.cargo/vendor/transpose
2023-01-14 18:28:39 +08:00
..
benches 更新libclamav库1.0.0版本 2023-01-14 18:28:39 +08:00
src 更新libclamav库1.0.0版本 2023-01-14 18:28:39 +08:00
tests 更新libclamav库1.0.0版本 2023-01-14 18:28:39 +08:00
.cargo-checksum.json 更新libclamav库1.0.0版本 2023-01-14 18:28:39 +08:00
Cargo.toml 更新libclamav库1.0.0版本 2023-01-14 18:28:39 +08:00
LICENSE-APACHE 更新libclamav库1.0.0版本 2023-01-14 18:28:39 +08:00
LICENSE-MIT 更新libclamav库1.0.0版本 2023-01-14 18:28:39 +08:00
README.md 更新libclamav库1.0.0版本 2023-01-14 18:28:39 +08:00
RELEASES.md 更新libclamav库1.0.0版本 2023-01-14 18:28:39 +08:00

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.