diff options
author | Tom Smeding <t.j.smeding@uu.nl> | 2024-06-10 13:23:38 +0200 |
---|---|---|
committer | Tom Smeding <t.j.smeding@uu.nl> | 2024-06-10 13:28:51 +0200 |
commit | 596bce9b869cafc06d9b1567c3a3ed282f7441ba (patch) | |
tree | 6406ea65d4ac1f099ac8851d2db38a5fca4bc4e3 /src/Data/Array/Nested | |
parent | 8274da734aba266e86ac722b6a9e73afeeae59e6 (diff) |
Rename arg{min,max} to {min,max}Index
Diffstat (limited to 'src/Data/Array/Nested')
-rw-r--r-- | src/Data/Array/Nested/Internal/Mixed.hs | 12 | ||||
-rw-r--r-- | src/Data/Array/Nested/Internal/Ranked.hs | 12 | ||||
-rw-r--r-- | src/Data/Array/Nested/Internal/Shaped.hs | 8 |
3 files changed, 16 insertions, 16 deletions
diff --git a/src/Data/Array/Nested/Internal/Mixed.hs b/src/Data/Array/Nested/Internal/Mixed.hs index 31c4e55..a0de08b 100644 --- a/src/Data/Array/Nested/Internal/Mixed.hs +++ b/src/Data/Array/Nested/Internal/Mixed.hs @@ -789,14 +789,14 @@ miota :: (Enum a, PrimElt a) => SNat n -> Mixed '[Just n] a miota sn = fromPrimitive $ M_Primitive (SKnown sn :$% ZSX) (X.iota sn) -- | Throws if the array is empty. -margMinPrim :: (PrimElt a, NumElt a) => Mixed sh a -> IIxX sh -margMinPrim (toPrimitive -> M_Primitive sh (XArray arr)) = - ixxFromList (ssxFromShape sh) (numEltArgMin arr) +mminIndexPrim :: (PrimElt a, NumElt a) => Mixed sh a -> IIxX sh +mminIndexPrim (toPrimitive -> M_Primitive sh (XArray arr)) = + ixxFromList (ssxFromShape sh) (numEltMinIndex arr) -- | Throws if the array is empty. -margMaxPrim :: (PrimElt a, NumElt a) => Mixed sh a -> IIxX sh -margMaxPrim (toPrimitive -> M_Primitive sh (XArray arr)) = - ixxFromList (ssxFromShape sh) (numEltArgMax arr) +mmaxIndexPrim :: (PrimElt a, NumElt a) => Mixed sh a -> IIxX sh +mmaxIndexPrim (toPrimitive -> M_Primitive sh (XArray arr)) = + ixxFromList (ssxFromShape sh) (numEltMaxIndex arr) mtoXArrayPrimP :: Mixed sh (Primitive a) -> (IShX sh, XArray sh a) mtoXArrayPrimP (M_Primitive sh arr) = (sh, arr) diff --git a/src/Data/Array/Nested/Internal/Ranked.hs b/src/Data/Array/Nested/Internal/Ranked.hs index c16cfb7..589f0c1 100644 --- a/src/Data/Array/Nested/Internal/Ranked.hs +++ b/src/Data/Array/Nested/Internal/Ranked.hs @@ -450,16 +450,16 @@ riota :: (Enum a, PrimElt a, Elt a) => Int -> Ranked 1 a riota n = TN.withSomeSNat (fromIntegral n) $ mtoRanked . miota -- | Throws if the array is empty. -rargMinPrim :: (PrimElt a, NumElt a) => Ranked n a -> IIxR n -rargMinPrim rarr@(Ranked arr) +rminIndexPrim :: (PrimElt a, NumElt a) => Ranked n a -> IIxR n +rminIndexPrim rarr@(Ranked arr) | Refl <- lemRankReplicate (rrank (rtoPrimitive rarr)) - = ixCvtXR (margMinPrim arr) + = ixCvtXR (mminIndexPrim arr) -- | Throws if the array is empty. -rargMaxPrim :: (PrimElt a, NumElt a) => Ranked n a -> IIxR n -rargMaxPrim rarr@(Ranked arr) +rmaxIndexPrim :: (PrimElt a, NumElt a) => Ranked n a -> IIxR n +rmaxIndexPrim rarr@(Ranked arr) | Refl <- lemRankReplicate (rrank (rtoPrimitive rarr)) - = ixCvtXR (margMaxPrim arr) + = ixCvtXR (mmaxIndexPrim arr) rtoXArrayPrimP :: Ranked n (Primitive a) -> (IShR n, XArray (Replicate n Nothing) a) rtoXArrayPrimP (Ranked arr) = first shCvtXR' (mtoXArrayPrimP arr) diff --git a/src/Data/Array/Nested/Internal/Shaped.hs b/src/Data/Array/Nested/Internal/Shaped.hs index fae486b..ca3fd45 100644 --- a/src/Data/Array/Nested/Internal/Shaped.hs +++ b/src/Data/Array/Nested/Internal/Shaped.hs @@ -374,12 +374,12 @@ siota :: (Enum a, PrimElt a) => SNat n -> Shaped '[n] a siota sn = Shaped (miota sn) -- | Throws if the array is empty. -sargMinPrim :: (PrimElt a, NumElt a) => Shaped sh a -> IIxS sh -sargMinPrim sarr@(Shaped arr) = ixCvtXS (sshape (stoPrimitive sarr)) (margMinPrim arr) +sminIndexPrim :: (PrimElt a, NumElt a) => Shaped sh a -> IIxS sh +sminIndexPrim sarr@(Shaped arr) = ixCvtXS (sshape (stoPrimitive sarr)) (mminIndexPrim arr) -- | Throws if the array is empty. -sargMaxPrim :: (PrimElt a, NumElt a) => Shaped sh a -> IIxS sh -sargMaxPrim sarr@(Shaped arr) = ixCvtXS (sshape (stoPrimitive sarr)) (margMaxPrim arr) +smaxIndexPrim :: (PrimElt a, NumElt a) => Shaped sh a -> IIxS sh +smaxIndexPrim sarr@(Shaped arr) = ixCvtXS (sshape (stoPrimitive sarr)) (mmaxIndexPrim arr) stoXArrayPrimP :: Shaped sh (Primitive a) -> (ShS sh, XArray (MapJust sh) a) stoXArrayPrimP (Shaped arr) = first shCvtXS' (mtoXArrayPrimP arr) |