Remove rank-index on Order type
This commit is contained in:
parent
a499d14e87
commit
76e16574f1
4 changed files with 30 additions and 63 deletions
|
|
@ -46,8 +46,12 @@ index [] x = x
|
|||
index (i::is) v = index is $ index i v
|
||||
|
||||
|
||||
export
|
||||
getLocation' : (sts : Vect rk Nat) -> (is : Vect rk Nat) -> Nat
|
||||
getLocation' = sum .: zipWith (*)
|
||||
|
||||
||| Compute the memory location of an array element
|
||||
||| given its coordinate and the strides of the array.
|
||||
export
|
||||
getLocation : Vect rk Nat -> Coords {rk} s -> Nat
|
||||
getLocation sts is = sum $ zipWith (*) sts (toNats is)
|
||||
getLocation sts is = getLocation' sts (toNats is)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue