orx_funvec/d3/into_index.rs
1use crate::index::{FromIndex, IntoIndex};
2
3const DIM: usize = 3;
4type Tuple = (usize, usize, usize);
5
6impl IntoIndex<DIM> for Tuple {
7 #[inline(always)]
8 fn into_index(self) -> [usize; DIM] {
9 [self.0, self.1, self.2]
10 }
11}
12
13impl FromIndex<DIM> for Tuple {
14 #[inline(always)]
15 fn from_index(index: [usize; DIM]) -> Self {
16 (index[0], index[1], index[2])
17 }
18}