Function ravel_index
pub fn ravel_index<I>(indices: &[I], shape: &[usize]) -> usizewhere
I: AsIndex,Expand description
Compute the ravel index for the given coordinates.
This returns the row-major order raveling:
strides[-1] = 1strides[i] = strides[i+1] * dims[i+1]dim_strides = coords * stridesravel = sum(dim_strides)
§Arguments
indices: the index for each dimension; must be the same length asshape.shape: the shape of each dimension; be the same length asindices.
§Returns
- the ravel offset index.