private void FindPSIandSHD() { int rowCount = _trainingDataTable.Rows.Count; int numberofAttributes = _headerLine.Count - 2; indexMatrix = new GsiAndShdIndexes[rowCount][]; for (int i = 0; i < rowCount; i++) { indexMatrix[i] = new GsiAndShdIndexes[i + 1]; } int totalCounter = 0; Parallel.For(0, rowCount, i => { DataRow rowA = _trainingDataTable.Rows[i]; int k = i + 1; for (int j = k; j < rowCount; j++) { DataRow rowB = _trainingDataTable.Rows[j]; GsiAndShdIndexes newIndex = new GsiAndShdIndexes(); newIndex.PsiIndex = CalculatePSI(rowA, rowB, numberofAttributes); newIndex.ShdIndex = CalculateSHD(rowA, rowB); indexMatrix[j][i] = newIndex; totalCounter++; } } ); }