F-style transformation of non-contiguous to contiguous layout

For a F-style non-contiguous layout with shape, (d0, d1, …, dN−1), the value associated with (n0, n1, …, nN−1) is located in the contiguous layout with index = nF.
expression for index in contiguous layout mapped from index in F-style non-contiguous layout
such that, if j > i−1
products of d sub j is 1 if start index is greater than final index

Examples illustrating transformation to contiguous layout in F-style

Eg.1: Location of element in x with index (1, 2, 1)

For a F-style non-contiguous layout with shape, (d0 = 2, d1 = 4, d2 = 3) the value in (n0 = 1, n1 = 2, n2 = 1) of the non-contiguous layout is located in the contiguous layout with index nF given by,

index in contiguous layout for (1, 2, 1) index in F-style non-contiguous layout is equal to 13
index in F-style non-contiguous layout into respective mapped index in contiguous layout

Eg.2: Location of element in x with index (1, 1, 1)

For a F-style non-contiguous layout with shape, (d0 = 2, d1 = 4, d2 = 3) the value in (n0 = 1, n1 = 1, n2 = 1) of the non-contiguous layout is located in the contiguous layout with index nFgiven by,

index in contiguous layout for (1, 1, 1) index in F-style non-contiguous layout is equal to 11

To move from the element with index (1, 2, 1) in the array x to the element at (1, 1, 1), two elements within the array must be jumped.