Skip to main content

linear_index

Function linear_index 

Source
pub fn linear_index(indices: &[usize], shape: &[usize]) -> usize
Expand description

Compute the C-order (row-major) flat index from multi-dimensional indices.

Panics in debug mode if indices.len() != shape.len().