this function do not check the bound panic if indices.len() != ndim
(&self, indices: &[usize])
| 250 | /// this function do not check the bound |
| 251 | /// panic if indices.len() != ndim |
| 252 | pub fn fast_position(&self, indices: &[usize]) -> isize { |
| 253 | let mut pos = 0; |
| 254 | for (i, (_, stride, suboffset)) in indices |
| 255 | .iter() |
| 256 | .cloned() |
| 257 | .zip_eq(self.dim_desc.iter().cloned()) |
| 258 | { |
| 259 | pos += i as isize * stride + suboffset; |
| 260 | } |
| 261 | pos |
| 262 | } |
| 263 | |
| 264 | /// panic if indices.len() != ndim |
| 265 | pub fn position(&self, indices: &[isize], vm: &VirtualMachine) -> PyResult<isize> { |