Beispiel #1
0
        protected double[] PrecessClasterByDimentions(List <double[]> claster, Func <STAT, double> geterResultValueFunc, Action <STAT> provessAction = null)
        {
            int n = claster[0].Length;
            int N = claster.Count;

            var arr = ArrayMatrix.TransposeArr(claster.ToArray());

            //for (int i = 0; i < N; i++)
            //    for (int j = 0; j < n; i++)
            //        arr[j][i] = claster[i][j];

            double[] result = new double[n];

            for (int i = 0; i < n; i++)
            {
                STAT s = new STAT();
                s.Setd2Stat2d(arr[i]);

                provessAction?.Invoke(s);

                result[i] = geterResultValueFunc(s);
            }

            return(result);
        }
Beispiel #2
0
        private double[] PrecessClasterByDimentions(List <double[]> claster, Func <STAT, double> geterResultValueFunc, Action <STAT> provessAction)
        {
            int n = claster[0].Length;
            int N = claster.Count;

            var arr = ArrayMatrix.GetJaggedArray(n, N);

            for (int i = 0; i < N; i++)
            {
                for (int j = 0; j < n; i++)
                {
                    arr[j][i] = claster[i][j];
                }
            }

            double[] result = new double[n];

            for (int i = 0; i < n; i++)
            {
                STAT s = new STAT();
                s.Setd2Stat2d(arr[i]);

                provessAction?.Invoke(s);

                result[i] = geterResultValueFunc(s);
            }

            return(result);
        }
Beispiel #3
0
        private static STAT[] GetTransiotionStats(Matrix MGKDirectResult)
        {
            var statsSize = MGKDirectResult.Columns;

            var TransoseMGKDirect = MGKDirectResult.Transpose();

            List <STAT> TransiotionStats = new List <STAT>();

            for (int i = 0; i < statsSize; i++)
            {
                STAT s = new STAT();
                s.Setd2Stat2d(TransoseMGKDirect.GetRow(i).GetCloneOfData());

                TransiotionStats.Add(s);
            }

            return(TransiotionStats.ToArray());
        }