CanvasCommon.DensityClusteringModel.EstimateDistance C# (CSharp) Метод

EstimateDistance() публичный Метод

Compute lower triangle of the distance matrix stored by columns in a vector. If n is the number of observations, then for i < j <= n, the dissimilarity between (column) i and (row) j is retrieved from index [n*i - i*(i+1)/2 + j-i+1]. The length of the distance vector is n*(n-1)/2.
public EstimateDistance ( ) : void
Результат void
        public void EstimateDistance()
        {
            int segmentsLength = this.Segments.Count;
            this.Distance = new List<double?>(segmentsLength * (segmentsLength - 1) / 2);
            for (int col = 0; col < segmentsLength; col++)
            {
                for (int row = col + 1; row < segmentsLength; row++)
                {
                    double? tmp = null;
                    if (this.Segments[col].MAF >= 0 && this.Segments[row].MAF >= 0)
                        tmp = GetEuclideanDistance(this.Segments[col].Coverage, this.Segments[row].Coverage, this.Segments[col].MAF, this.Segments[row].MAF);
                    this.Distance.Add(tmp);
                }
            }
        }