aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array/Nested/Internal/Ranked.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-06-10 10:02:59 +0200
committerTom Smeding <t.j.smeding@uu.nl>2024-06-10 16:17:09 +0200
commit205a20fd581bb7c5728fd457a15e4f78fbee9e75 (patch)
treef6669ea87b56dde0f6168c109b3d7d7fcbf06136 /src/Data/Array/Nested/Internal/Ranked.hs
parentc211316a4ab43cf34d6567c6919a3922d5840ae0 (diff)
Dot product
Diffstat (limited to 'src/Data/Array/Nested/Internal/Ranked.hs')
-rw-r--r--src/Data/Array/Nested/Internal/Ranked.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Data/Array/Nested/Internal/Ranked.hs b/src/Data/Array/Nested/Internal/Ranked.hs
index 589f0c1..c67e892 100644
--- a/src/Data/Array/Nested/Internal/Ranked.hs
+++ b/src/Data/Array/Nested/Internal/Ranked.hs
@@ -461,6 +461,9 @@ rmaxIndexPrim rarr@(Ranked arr)
| Refl <- lemRankReplicate (rrank (rtoPrimitive rarr))
= ixCvtXR (mmaxIndexPrim arr)
+rdot :: (PrimElt a, NumElt a) => Ranked 1 a -> Ranked 1 a -> a
+rdot = coerce mdot
+
rtoXArrayPrimP :: Ranked n (Primitive a) -> (IShR n, XArray (Replicate n Nothing) a)
rtoXArrayPrimP (Ranked arr) = first shCvtXR' (mtoXArrayPrimP arr)