Beispiel #1
0
        public static float L2DistSquared(ReadOnlySpan <float> a, ReadOnlySpan <float> b, int count)
        {
            Contracts.AssertNonEmpty(a);
            Contracts.AssertNonEmpty(b);
            Contracts.Assert(0 < count && count <= a.Length);
            Contracts.Assert(count <= b.Length);

            unsafe
            {
                fixed(float *pa = &MemoryMarshal.GetReference(a))
                fixed(float *pb = &MemoryMarshal.GetReference(b))
                return(Thunk.Dist2(pa, pb, count));
            }
        }