public float[] GetCosineDistance(float[][] vectors1, float[][] vectors2)
        {
            int m1Length = vectors1.Length,
                m2Length = vectors2.Length;

            float[] result = new float[m1Length * m2Length];
            for (int i = 0; i < m1Length; i++)
            {
                for (int j = 0; j < m2Length; j++)
                {
                    result[(i * m2Length) + j] = singleCalc.GetCosineDistance(vectors1[i], vectors2[j]);
                }
            }

            return(result);
        }
        public float[] GetCosineDistance(float[][] vectors1, float[][] vectors2)
        {
            int m1Length = vectors1.Length,
                m2Length = vectors2.Length;

            float[] result = new float[m1Length * m2Length];
            Parallel.For(0, m1Length,
                         (i) =>
            {
                float[] vector1 = vectors1[i];
                for (int j = 0; j < m2Length; j++)
                {
                    result[(i * m2Length) + j] = singleCalc.GetCosineDistance(vector1, vectors2[j]);
                }
            }
                         );
            return(result);
        }